Raiso Posted January 18, 2009 Share Posted January 18, 2009 Hi guys, I have a little qeustion. I have a picture on my ftp it called "FC Twente.png" and as you can see there is a space in the name. Now i want to load that picture from a code Like: if($r['club'] == "FC Twente") { $clubpic="FC Twente.png"; } but this doesn't work, because then he load only FC And I have triet to but it don't work to. Normaly I just change the picture name but it are 750 picture's so I hope someone can help me. Thnx. Grtz, Raiso Link to comment https://forums.phpfreaks.com/topic/141267-image-space/ Share on other sites More sharing options...
DeanWhitehouse Posted January 18, 2009 Share Posted January 18, 2009 str_replace(" ","",$r['club']); That will remove the space e.g. if(str_replace(" ","",$r['club']) == "FCTwente") $clubpic="FC Twente.png"; Link to comment https://forums.phpfreaks.com/topic/141267-image-space/#findComment-739402 Share on other sites More sharing options...
Raiso Posted January 18, 2009 Author Share Posted January 18, 2009 no you don't get the question. There is a space in FC Twente.png But if i just typ <img src=FC Twente.png> he just load http://www.mysite.com/FC and it has to load http://www.mysite.com/FC Twente.png Link to comment https://forums.phpfreaks.com/topic/141267-image-space/#findComment-739403 Share on other sites More sharing options...
dawsba Posted January 18, 2009 Share Posted January 18, 2009 i've just tried and it works fine..... what is $r['club'] can you echo that please Link to comment https://forums.phpfreaks.com/topic/141267-image-space/#findComment-739410 Share on other sites More sharing options...
Raiso Posted January 18, 2009 Author Share Posted January 18, 2009 I already have it Just %20 haha Thnx anyway guys you all Link to comment https://forums.phpfreaks.com/topic/141267-image-space/#findComment-739418 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.