php 正则替换函数 ereg_replace

作者:袖梨 2022-07-02

    

 代码如下 复制代码
$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==========";

相关文章

精彩推荐