Page 1 of 1

[SOLVED] str_replace troubles..

Posted: Sun Sep 10, 2006 6:40 am
by tommy1987
here is my problem:

$imgurl may = catphotos/cploughmanssmall.gif
But the file will change, hence I want to write some code which will take the small.gif from the end and replace it with large.gif but am having some trouble doing this. Here is my code...

Code: Select all

$imgurl = str_replace('%small.gif', 'large.gif', $imgurl);
Can someone please tell me what I am doing wrong so that I can learn, appreciate the help.. have tried php.net but cant get much joy out of the function manual.

Posted: Sun Sep 10, 2006 6:45 am
by volka
is there really a % character in your code?

Posted: Sun Sep 10, 2006 6:50 am
by tommy1987
lol sorted.. Cheers//