[SOLVED] str_replace troubles..

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
tommy1987
Forum Commoner
Posts: 92
Joined: Tue Feb 21, 2006 8:35 pm

[SOLVED] str_replace troubles..

Post 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.
User avatar
volka
DevNet Evangelist
Posts: 8391
Joined: Tue May 07, 2002 9:48 am
Location: Berlin, ger

Post by volka »

is there really a % character in your code?
tommy1987
Forum Commoner
Posts: 92
Joined: Tue Feb 21, 2006 8:35 pm

Post by tommy1987 »

lol sorted.. Cheers//
Post Reply