Re: Subject: + character in a command line argument
| From: | mmy | Date: | Tue, 01 Apr 2003 19:44:39 +0000 |
| Subject: | Re: Subject: + character in a command line argument | ||
| References: | 1 | Groups: | php.windows |
| Request: | Send a blank email to php-windows+get-19232@lists.php.net to get a copy of this message | ||
Thanks for the try!
No, I did not up to now. Unfortunately, the result of the test is that this
is taken as face value (the 3 characters). However, % has indeed some
syntactic use: it is an escape for the double quote (%" yields a double
quote, and no split), and for itslef (%% yields %), but not for antislash.
In-between, I found that antislash is an escape for the double quote, but
not for % or \. \2b is seen as the three characters...
Still nothing to escape the +...
This is really weird!
I can't believe that this is specified nowhere! For DOS command lines, or
Windows command line, I found 10's of sites listing the commands, but never
the basic syntax!
"Max Graham" <czero@lonebraincell.com> a écrit dans le message news:
019d01c2f87c$6df96810$6701a8c0@teivrann...
> Have you tried replacing the + with %2B?
>
> Having never tried this before myself, this is sort of a shot in the dark
> ... but I figured it might give you an idea as to where to go from
>
>
> > Message-ID: <20030330092606.70268.qmail@pb1.pair.com>
> > To: php-windows@lists.php.net
> > From: "mmy" <mmouly@wanadoo.fr>
> > Date: Sun, 30 Mar 2003 11:30:22 +0200
> > Subject: + character in a command line argument
> >
> > Hi!
> >
> > I'm using PHP 4.3.1, IE 5.5, Win ME
> >
> > I'm trying to use php through DOS command line.
> >
> > Running the very basic script
> >
> > $argv = $_SERVER['argv'];
> > var_dump($argv);
> >
> > I noticed that the command line arguments are split at a + character,
even
> > if between double quotes.
> >
> > for instance
> >
> > php test.php a+b
> >
> > or
> >
> > php test.php "a+b"
> >
> > both return 3 arguments, "test.php", "a" and "b".
> >
> > I don't know if it is a DOS or php problem (though if you name a file
> > a+b.txt, the DOS command type a+b.txt runs correctly, which seems to
> > exonerate DOS...).
> >
> > My questions are more practical : does anybody knows how to pass a + in
an
> > argument?? Are there other characters that are special in addition to "
> and
> > + ??
> >
> > Thanks in advance
>