[PHP] Bug with + sign when using CLI?
I'm using the CLI script shown below to parse and show all argv variables passed to it. ## -rwxr-xr-x1 nobody nobody plusbug.php ## #!/usr/bin/php -q ?PHP print_r($_SERVER['argv']); ? ### END ## Command being entered: ./plusbug.php 'something+something' Output: Array ( [0] = ./plusbug.php [1] = something [2] = something ) I found nothing about a + splitting argument variables anywhere in the CLI documentation though I know this is a CGI characteristic. I've tried escaping the + character to no avail. I need to pass a string with a + character in it, anyone know anything I can do other than repopulating the character back into the string within the php script which would make what I'm trying to accomplish very difficult. In the php.ini I have: register_globals = On register_argc_argv = On Note: If I have either of these turned off, I am not even able to pick-up the arguments passed to the script whether I use $argv or $_SERVER['argv']. PHP Version: 4.2.3 Regards, Bronson_AT_udatasystems.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Bug with + sign when using CLI?
On Fri, 6 Dec 2002, Charles Bronson wrote: I found nothing about a + splitting argument variables anywhere in the CLI documentation though I know this is a CGI characteristic. I've tried escaping the + character to no avail. Check out the bug: http://bugs.php.net/bug.php?id=18566 I experienced the same thing (Linux 2.4.17, Apache 1.3.26, PHP 4.2.2 mod_php CGI). I can't really tell if there is a fix, or intent to fix it, since the bug is still open. Perhaps there is a mention of this issue in the changelogs of more recent versions. g.luck, ~Chris -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php