WorldDrknss Posted September 21, 2007 Share Posted September 21, 2007 This is probably a simple one but I am having problems with a search feature. I use get as for my form method and I use mysql boolean mode for my searches. My get variable returns: search.php?srch=guides+procedures%2Bbylaws I know the plus symbol is a space and %2B is suppose to equal a literal plus symbol but using the php function urldecode also turns that string into a space also. I have tried: $searchtxt = str_replace("%2B", "#43", $_GET['srch']); $srchr = urldecode($searchtxt); and str_replace("%2B", "#43", urldecode($_GET['srch']) and I am stumped. It's probably because it is something so simple. TIA Link to comment https://forums.phpfreaks.com/topic/70123-solved-form-get/ Share on other sites More sharing options...
sdi126 Posted September 21, 2007 Share Posted September 21, 2007 You will want to use rawurldecode instead of urldecode. This function returns a string in which the sequences with percent (%) signs followed by two hex digits have been replaced with literal characters where as urldecode just decodes any %## encoding. Link to comment https://forums.phpfreaks.com/topic/70123-solved-form-get/#findComment-352189 Share on other sites More sharing options...
WorldDrknss Posted September 22, 2007 Author Share Posted September 22, 2007 Thanks just what I needed. Link to comment https://forums.phpfreaks.com/topic/70123-solved-form-get/#findComment-352990 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.