正则

PHP正则操作相关

1 $sImageurl = 'http://i3.meishichina.com/http://i3.meishichina.com/attachment/good/2015/05/13/201505131431525637778.jpg';

2 $sImageurl = preg_replace('/(http:\/\/\w{2}\.[a-z]+\.com\/)\1(.*)/','$1$2',$sImageurl);

3 echo $sImageurl;//http://i3.meishichina.com/attachment/good/2015/05/13/201505131431525637778.jpg

持续更新2015-07-02

你可能感兴趣的:(正则)