怎么查找一个文章里包含有abc.com域名下的JS。
如一个字段时有XXXXXXXXXXX <script></script>XXXXXXXsdfa
用正则吧,无敌的正则帮你匹配,你只要做个判断匹配到就输出,正则现在本人不会写,可以在这里求诸大神们帮忙
$s=<<<txt如一个字段时有XXXXXXXXXXX<script src='http://www.abc.com/js/aaa.js' language='javascript'></script>XXXXXXX<a href="www.abc.com">sdfa</a><script src='http://www.def.com/js/bbb.js' language='javascript'>txt;preg_match_all("/<script[^>]*src='.+abc\.com[^>]+>/sU",$s,$m);print_r($m[0]);
preg_match_all("/
要懂得尊重别人!!!
$s=<<<txt如一个字段时有XXXXXXXXXXX<script src='http://www.abc.com/js/aaa.js' language='javascript'></script>XXXXXXX<a href="www.abc.com">sdfa</a><script src='http://www.def.com/js/bbb.js' language='javascript'>txt;preg_match_all("/<script[^>]*src='.+abc\.com[^>]+>/sU",$s,$m);print_r($m[0]);