|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
[1998-07-11 20:23 UTC] ben dot lavender at cygnet dot co dot uk
How can I test argc in an if statement?
if ( argv > 0)
{
echo ("there are args");
}
this always fails.
[3] Once I have run
Calling hello.php?a=world&b=tree
parse_str($argv[0]);
if ( ! (isset($a) && isset($b)) )
{
echo ("failure");
}
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
|
|||||||||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Fri Nov 07 13:00:01 2025 UTC |
if($argc > 0) { echo "There are args"; } But why do you call parse_str() yourself? In your hello.php example the $a and $b variables will automatically be set by PHP. You do not need to run parse_str() (By the way, this is not a bug. Questions should be sent to php3@lists.php.net)