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? Quote Link to comment 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 Quote Link to comment 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 Quote Link to comment 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 Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.