我想要file_get_contents数组中的每一个链接。因此,我可以应用preg_match代码,然后匹配检测到的第一个p标签中的前20个字符。File_Get_Contents整个数组
我的代码如下:
$links = array(0 => "http://en.wikipedia.org/wiki/The_Big_Bang_Theory", 1=> "http://en.wikipedia.org/wiki/Fantastic_Four");
print_r($links);
$link = implode(", " , $links);
$html = file_get_contents($link);
preg_match('%(<p[^>]*>.*?</p>)%i', $html, $re);
$res = get_custom_excerpt($re[1]);
echo $res;