php中正则替换函数ereg_replace用法实例
本文实例讲述了php中正则替换函数ereg_replace用法。分享给大家供大家参考。具体如下:
下面的实例是利用php正则替换函数ereg_replace来把指定的字符替换成我想需要的字符实例,代码如下:
$num='www.nhooo.com';
$string="thisstringhasfourwords.<br>";
$string=ereg_replace('four',$num,$string);
echo$string;
$num='49'; $string="thisstringhasfourwords"; $string=ereg_replace('four',$num,$string); echo$string;
$string="测试用文字"; echo"**********$string**********<p>"; $string=ereg_replace("^","<br>",$string); $string=ereg_replace("$","<br>",$string); echo"==========$string==========";
热门推荐
1 训练狗狗工作
4 狗狗定点排便训练
5 狗狗训练吠叫
6 狗狗尿垫训练
7 狗狗训练座
8 狗狗训练攻略
9 狗狗训练记
10 做训练狗狗
11 狗狗训练词
12 狗狗谢谢怎么训练
13 狗狗训练如厕
14 狗狗太凶怎么训练
15 狗狗训练它
16 狗狗克制训练
17 训练基地狗狗
18 怎么样训练狗狗大小硬