Re: stripping %20 and other characters from query string
| From: | Jonathan Pitcher | Date: | Thu, 06 Feb 2003 21:48:31 +0000 |
| Subject: | Re: stripping %20 and other characters from query string | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-134682@lists.php.net to get a copy of this message | ||
Sarah,
There are a couple functions that could do this for you.
Probably the fastest one for your example would be as follows.
$NewString = str_replace('%20', ' ', $value); // Removes the %20 characters
$NewString = str_replace '\', '', $NewString); // Removes \ character
echo $NewString;
http://www.php.net/manual/en/function.str-replace.php
On Thursday, February 6, 2003, at 03:39 PM, Sarah Gray wrote:
Hello, Forgive me if this is an obvious question, but I am passing a value (a string with spaces and quotations) back in a query string and do not know how to strip the extra characters that have been placed into it. For example. $value = "Sarah's Test Page" query string = mypage.php?value=Sarah\\\'s%20Test%20Page echo $value = Sarah\\\'s%20Test%20Page What is the command to strip out these extra space and escape characters so that when I echo $value it prints out "Sarah's Test Page"? Much Appreciated, s. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php