输入banner图图片脚本导航/分类

得到文章中第一个图片的链接

<无详细内容>
  1. function pickupImage($html) {
  2. preg_match_all('//U', $html, $matches, PREG_PATTERN_ORDER);
  3. if(count($matches[0]) > 0) {
  4. foreach ($matches[0] as $match)
  5. {
  6. preg_match('/src="http://img.gxlcms.com/(.+)"/U', $match, $src);
  7. return $src[1];
  8. }
  9. }
  10. else
  11. return '';
  12. }