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

最新下载

热门教程

php 正则替换函数 ereg_replace

时间:2010-08-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==========";

热门栏目