麻烦看下这个正则 preg_match_all ('/http:.*?\.png|http:.*?\.gif/', $buffer, $array);因为.* 可以匹配任何字符 默认时,数量符是“贪吃型”(greedy)的,即会在不导致剩余模式失败的情况下尽可能多地匹配(直到所允许的数目上限)。 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 preg_match_all ('/http:[^:]*\.png|http:[^:]*\.gif/', $buffer, $array); $buffer = 'http://a/images/quote.png) no-repeat 0px 0px;padding:0px 0px 5px 23px;background:url(http://b/images/quote_small.gif'; preg_match_all ('/http:\/\/([^)]+)/', $buffer, $array); foreach( $array[0] as $key => $value){ echo "<a href='$value' target='_blank'>" . $value . "<br />"; } $buffer = 'http://a/images/quote.gif) no-repeat 0px 0px;padding:0px 0px 5px 23px;background:url(http://b/images/quote_small.gif';preg_match_all ('/http:.*\.png|http:.*\.gif/siU', $buffer, $array);foreach( $array[0] as $key => $value){ echo "<a href='$value' target='_blank'>" . $value . "<br />";} MYSQL 特殊字符怎么处理? move_uploaded_file函数问题 奇怪,E_ALL&~NOTICE并不现实include文件错误信息? php在windows2003下的日期问题。 关于PHP程序读取MySQL数据库中的中文值的显示成问号的问题!(在线等) 正规表达式问题....请教.. 求一php写法!! 当form不在循环以内,如何通过这个form一次性提交循环以内的所有input的值, 用php做的文件管理系统,若提交的内容里含有excel做的表格怎么做 一个简单问题请教,在线等分 php查找指定目录下的文件 php备份mysql数据加
$buffer = 'http://a/images/quote.png) no-repeat 0px 0px;padding:0px 0px 5px 23px;background:url(http://b/images/quote_small.gif';
preg_match_all ('/http:\/\/([^)]+)/', $buffer, $array);
foreach( $array[0] as $key => $value){
echo "<a href='$value' target='_blank'>" . $value . "<br />";
}
$buffer = 'http://a/images/quote.gif) no-repeat 0px 0px;padding:0px 0px 5px 23px;background:url(http://b/images/quote_small.gif';
preg_match_all ('/http:.*\.png|http:.*\.gif/siU', $buffer, $array);
foreach( $array[0] as $key => $value){
echo "<a href='$value' target='_blank'>" . $value . "<br />";
}