Michdd Posted October 23, 2008 Share Posted October 23, 2008 I was trying this: $geturl = $row['url']; $geturl = $str_replace(' ', '%', $geturl); So basically it would replace spaces in a URL with a %, I need it to do this because I'm using a getimagesize() function to determine weather or not to thumbnail an image. Link to comment https://forums.phpfreaks.com/topic/129681-replacing-spaces-in-a-string-str_replace-doesnt-work/ Share on other sites More sharing options...
prexep Posted October 23, 2008 Share Posted October 23, 2008 Spaces are %20 in a url. $geturl = $str_replace(' ', '%', $geturl); should be $geturl = str_replace(' ', '%', $geturl); Link to comment https://forums.phpfreaks.com/topic/129681-replacing-spaces-in-a-string-str_replace-doesnt-work/#findComment-672369 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.