php 正則替換函數 ereg_replace下面的實例是利用php 正則替換函數 ereg_replace來把指定的字符替換成我想需要的字符實例。
php教程 正則替換函數 ereg_replace
下面的實例是利用php 正則替換函數 ereg_replace來把指定的字符替換成我想需要的字符實例。
*/
$num = 'www.bkjia.com';
$string = "this string has four words.
";
$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**********";
$string = ereg_replace ("^", "
", $string);
$string = ereg_replace ("$", "
", $string);
echo "==========$string==========";