欧美bbbwbbbw肥妇,免费乱码人妻系列日韩,一级黄片

php中正則替換函數(shù)ereg_replace用法實例

 更新時間:2014年12月19日 10:04:48   投稿:shichen2014  
這篇文章主要介紹了php中正則替換函數(shù)ereg_replace用法,以實例形式分析了ereg_replace函數(shù)進行正則替換時的用法,非常具有實用價值,需要的朋友可以參考下

本文實例講述了php中正則替換函數(shù)ereg_replace用法。分享給大家供大家參考。具體如下:

下面的實例是利用php 正則替換函數(shù) ereg_replace來把指定的字符替換成我想需要的字符實例,代碼如下:

復制代碼 代碼如下:
$num = 'www.dbjr.com.cn';
$string = "this string has four words. <br>";
$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**********<p>";
$string = ereg_replace ("^", "<br>", $string);
$string = ereg_replace ("$", "<br>", $string);
echo "==========$string==========";

希望本文所述對大家的正則表達式學習有所幫助。

相關(guān)文章

最新評論