Preg_match ile ereg_match değiştirin

0 Cevap php

Dear Sir/m'am How can i replace ther deprecated ereg_replace with preg_replace or str_replace and still have the same functionality as in the code below?

return ereg_replace("^(.*)%%number%%(.*)$","\\1$i\\2",$number);

///this doesnt work

return preg_replace("^(.*)%%number%%(.*)$","\\1$i\\2",$number);

Herkes akıllı bir ipucu var mı?

0 Cevap