#50191 [Opn->Bgs]: $SERVER['argv'] not working as expected

From: Date: Mon, 16 Nov 2009 16:20:35 +0000
Subject: #50191 [Opn->Bgs]: $SERVER['argv'] not working as expected
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-144676@lists.php.net to get a copy of this message
ID: 50191 Updated by: jani@php.net Reported By: ppass at hotmail dot fr -Status: Open +Status: Bogus Bug Type: URL related Operating System: Windows PHP Version: 5.2.11 New Comment: This variable is meant for COMMAND line only. Previous Comments: ------------------------------------------------------------------------ [2009-11-16 16:06:35] ppass at hotmail dot fr Description: ------------ I sometimes use URLs with several arguments. The value of some of arguments are urlencoded, so a space will be translated to a + sign. The problem is that $SERVER['argv'] seems to interpret this + sign by as a separator. Reproduce code: --------------- File: argv_behaviour.php <?php Echo "<br/>List of arguments: (".$_SERVER['argv'][0].")"; ?> Expected result: ---------------- When launching argv_behaviour.php?arg1=aa&arg2=b+c&arg3=dd I expect to see List of arguments: (arg1=aa&arg2=b+c&arg3=dd) Actual result: -------------- but I get List of arguments: (arg1=aa&arg2=b) I get the wrong number of arguments and truncated value for some of them. ------------------------------------------------------------------------ -- Edit this bug report at http://bugs.php.net/?id=50191&edit=1

« previous php.bugs (#144676) next »