php 正则替换函数 ereg_replace
php教程 正则替换函数 ereg_replace
下面的实例是利用php 正则替换函数 ereg_replace来把指定的字符替换成我想需要的字符实例。
*/
$num = 'www.zzzyk.com';
$string = "this string has four words. <br>";
$string = ereg_replace ('four', $num, $string);
echo $string;
$num = '49';
$string = "this string has four words";
$string = ereg_replace ('four', $num, $string);
echo $string;
$string ="测试用文字";
echo "**********$string**********<p>";
$string = ereg_replace ("^", "<br>", $string);
$string = ereg_replace ("$", "<br>", $string);
echo "==========$string==========";
补充:Php教程,Php函数