Accurax Posted June 9, 2007 Share Posted June 9, 2007 I want to be able to apss strings pulled from my database through my URL so i can $_GET them, I can pass them manually by swapping any spaces out with a +, but i cant figure out how to do this automatically, ive been playing with preg_replace, but it doesnt seem to want to play. anyone know how to do this? Link to comment https://forums.phpfreaks.com/topic/54886-solved-simple-question/ Share on other sites More sharing options...
taith Posted June 9, 2007 Share Posted June 9, 2007 yes? $string='I like cheese'; $string=str_replace(' ','+',trim($string)); echo $string; #I+like+cheese Link to comment https://forums.phpfreaks.com/topic/54886-solved-simple-question/#findComment-271433 Share on other sites More sharing options...
Accurax Posted June 9, 2007 Author Share Posted June 9, 2007 your a star taith ... thankyou so much dont suppose you could take a peak at my strip_slashes problem could you Link to comment https://forums.phpfreaks.com/topic/54886-solved-simple-question/#findComment-271440 Share on other sites More sharing options...
wildteen88 Posted June 9, 2007 Share Posted June 9, 2007 You'd be better of using urlencode if you are passing a string from a database through GET Link to comment https://forums.phpfreaks.com/topic/54886-solved-simple-question/#findComment-271536 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.