慕粉1220028519
2017-04-22 10:46
<?php
$text = "This is a link to http://www.wjigilmore.com/.";
echo preg_replace("/http:\/\/(.*)\//","<a href = \"\${0}\">\${0}</a>",$text);
?>
不是应该是This is a link to
<a herf ="http:// www.wjigilmore.com/"> http://www.wjigilmore.com/<a/>.吗?
注意是替换掉了
PHP进阶篇
181835 学习 · 2577 问题
相似问题