Nevergiveu 报错<b>Fatal error</b>: Call to undefined function dr_get_content_img() in <b>D:\phpStudy\PHPTutorial\WWW\cache\templates\templates.pc.koilee.home.news.category.html.cache.php</b> on line <b>1</b><br />
梦想飞翔Nevergiveu <b>Fatal error</b>: Call to undefined function dr_get_content_img() in <b>D:\phpStudy\PHPTutorial\WWW\cache\templates\templates.pc.koilee.home.news.show.html.cache.php</b> on line <b>51</b><br />
长沙小陈 依然报错<b>Fatal error</b>: Call to undefined function dr_get_content_img() in <b>D:\phpStudy\PHPTutorial\WWW\cache\templates\templates.pc.koilee.home.news.category.html.cache.php</b> on line <b>22</b><br />
阿初 <b>Fatal error</b>: Call to undefined function dr_get_content_img() in <b>D:\phpStudy\PHPTutorial\WWW\cache\templates\templates.pc.koilee.home.news.category.html.cache.php</b> on line <b>4</b><br />
http://www.wendacms.com/10439.html
用这个方法
// 获取内容中的缩略图 function dr_get_content_img($value, $num = 0) { $rt = array(); $value = preg_replace('/\.(gif|jpg|jpeg|png)@(.*)(\'|")/iU', '.$1$3', $value); if (preg_match_all("/(src)=([\"|']?)([^ \"'>]+\.(gif|jpg|jpeg|png))\\2/i", $value, $imgs)) { $imgs[3] = array_unique($imgs[3]); foreach ($imgs[3] as $i => $img) { if ($num && $i+1 > $num) { break; } $rt[] = dr_file($img); } } return $rt; }