萬盛學電腦網

 萬盛學電腦網 >> 網絡編程 >> php編程 >> php str_replace 和substr實例函數

php str_replace 和substr實例函數

 $newpic='http://upload.111cn.net/';
 $oldpic='http://down.111cn.net/uploads/';
 $litpic='http://down.111cn.net/uploads/allimg/101124/1_21292911l.jpg';
 $litpic = str_replace($oldpic,$newpic,$litpic);
 /*$litpic = $newpic.substr($litpic,strlen($oldpic));*/
 echo $litpic;

copyright © 萬盛學電腦網 all rights reserved