当前位置:Gxlcms > PHP教程 > php正则替换函数ereg_replace_PHP教程

php正则替换函数ereg_replace_PHP教程

时间:2021-07-01 10:21:17 帮助过:3人阅读

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==========";


www.bkjia.comtruehttp://www.bkjia.com/PHPjc/445434.htmlTechArticlephp 正则替换函数 ereg_replace下面的实例是利用php 正则替换函数 ereg_replace来把指定的字符替换成我想需要的字符实例。 php教程 正则替换函数...

人气教程排行