|
<?php $String = "text text text [a]this is a link[/a] text text [a]this is another link[/a] text text text text";
$String = preg_replace( "/\[a\](.+?)\[\/a\]/" , "<a href=\"\\1\">\\1</a>", $String );
echo("Change to html: $String<br/ >");
$String = preg_replace( "#<a href=\"(.+?)\">(.+?)</a>#" , "[a]\\1[/a]", $String );
echo("Back to ubb: $String<br/ >");
?>
上一篇:ThinkTemplate模板引擎的设计和使用 下一篇:RHEL下架设MYSQL集群
|