note 32764 added to features.commandline

From: Date: Fri, 06 Jun 2003 03:58:17 +0000
Subject: note 32764 added to features.commandline
Groups: php.notes 
Request: Send a blank email to php-notes+get-49839@lists.php.net to get a copy of this message
I get the following: [root@web0 zentrack]# php -v PHP 4.3.2 (cli) (built: Jun 3 2003 23:12:21) Copyright (c) 1997-2003 The PHP Group Zend Engine v1.3.0, Copyright (c) 1998-2003 Zend Technologies [root@web0 zentrack]# ./test.php ./test.php: ?php: No such file or directory ./test.php: line 4: syntax error near unexpected token `in_array($argv[1],' ./test.php: line 4: `if ($argc != 2 || in_array($argv[1], array('--help', '-help', '-h', '-?'))) {' For some reason it doesn't like the <?php .. I can execute the the file from the commandline "php test.php" which works. #!/usr/local/bin/php <?php if ($argc != 2 || in_array($argv[1], array('--help', '-help', '-h', '-?'))) { ?> This is a command line PHP script with one option. Usage: <?php echo $argv[0]; ?> <option> <option> can be some word you would like to print out. With the --help, -help, -h, or -? options, you can get this help. <?php } else { echo $argv[1]; } ?> The above doesn't work and the path to the php file is correct. ?? Please help? ---- Manual Page -- http://www.php.net/manual/en/features.commandline.php Edit Note -- http://master.php.net/manage/user-notes.php?action=edit+32764 Delete Note -- http://master.php.net/manage/user-notes.php?action=delete+32764&report=yes Reject Note -- http://master.php.net/manage/user-notes.php?action=reject+32764&report=yes

« previous php.notes (#49839) next »