Usage examples of the regular replacement function ereg_replace in php
The following example is to use the regular replacement function ereg_replace in php to replace the specified characters with the character examples I want. The code is as follows:
The code is as follows:
$num = 'www.jb51.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 ="Test text";
echo "**********$string************
";
$string = ereg_replace ("^", "
", $string);
$string = ereg_replace ("$", "
", $string);
echo "==========$string==========";
http://www.bkjia.com/PHPjc/930077.htmlwww.bkjia.comtruehttp: //www.bkjia.com/PHPjc/930077.htmlTechArticleUsage examples of the regular replacement function ereg_replace in php. The following example uses the regular replacement function ereg_replace in php to replace the specified characters. Into the character example I want, the code is as follows: Code...