kiowa_jackson Posted January 20, 2008 Share Posted January 20, 2008 Say I have a variable $ins, and on my site I use <h1>Welcome to my site about <?php echo $_GET['ins']; ?>!</h1> is there anyway I can set the $ins to contain spaces in it? Say I want the phrase "vintage motor boats" to appear in the headline. Since I can't use spaces in the url, right now I have to use the value "vintage-motor-boats", which looks terrible in the headline. Is there any way around this? Thanks Link to comment https://forums.phpfreaks.com/topic/86929-solved-inserting-values-with-spaces-in-to-text/ Share on other sites More sharing options...
trq Posted January 20, 2008 Share Posted January 20, 2008 Take a look at urlencode and urldecode. Link to comment https://forums.phpfreaks.com/topic/86929-solved-inserting-values-with-spaces-in-to-text/#findComment-444414 Share on other sites More sharing options...
kiowa_jackson Posted January 20, 2008 Author Share Posted January 20, 2008 Thanks. I'm unsure how to write it though, I tried <h1>Welcome to my site about <?php echo $_GET['urldecode($ins']; ?>!</h1> but it doesn't work. Have tried other variations but I'm just guessing...how would I use it? Link to comment https://forums.phpfreaks.com/topic/86929-solved-inserting-values-with-spaces-in-to-text/#findComment-444436 Share on other sites More sharing options...
Fyorl Posted January 20, 2008 Share Posted January 20, 2008 echo urldecode($_GET['ins']); Link to comment https://forums.phpfreaks.com/topic/86929-solved-inserting-values-with-spaces-in-to-text/#findComment-444438 Share on other sites More sharing options...
kiowa_jackson Posted January 20, 2008 Author Share Posted January 20, 2008 Awesome, thank you so much! Link to comment https://forums.phpfreaks.com/topic/86929-solved-inserting-values-with-spaces-in-to-text/#findComment-444446 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.