Re: Syntax checker? Character replacing
| From: | Adam | Date: | Fri, 06 Mar 2009 20:25:06 +0000 |
| Subject: | Re: Syntax checker? Character replacing | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-289486@lists.php.net to get a copy of this message | ||
just clean up your code and it will work:
<?php
$qString = 'http://www.google.ca/search?hl=en&q=php+rocks%21%21%21&meta=';
if (isset($qString))
{
$buffer = str_replace("&","&",$qString);
}
echo $buffer."\n";
?>
OUTPUT:
C:\>php test.php
http://www.google.ca/search?hl=en&q=php+rocks%21%21%21&meta=
C:\>
On Fri, Mar 6, 2009 at 3:05 PM, Terion Miller <webdev.terion@gmail.com> wrote:
> I have this and think maybe something is off, because if there is an amp (&)
> in the location then it only displays a comma , and nothing else:
>
> if (isset($_SERVER['QUERY_STRING'])) {$Page .= ($_SERVER['QUERY_STRING']?
> '?'.
> str_replace("&","&",$_SERVER['QUERY_STRING']) :
> '');}
>
>
> is that wrong?
>
--
Adi...