一聚教程网:一个值得你收藏的教程网站

最新下载

热门教程

php 正则替换函数 ereg_replace

时间:2022-07-02 09:51:16 编辑:袖梨 来源:一聚教程网

    

 代码如下 复制代码
$num = 'www.111com.net';
     $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==========";

热门栏目