php替换html里面的内容

已知下面一段html

$a="【php替换html里面的内容】php替换html里面的内容
文章图片
这样我觉得挺麻烦的
升级用法:
$host="http://mp.csdn.net" $newContent =preg_replace_callback("/php替换html里面的内容
文章图片

这个方法虽然用得少但是批处理的时候看效果超级好哟!
这种闭包函数我个人挺喜欢的。代码阅读性很高

    推荐阅读