note 51359 added to features.commandline
| From: | merrittd at dhcmc dot com | Date: | Mon, 28 Mar 2005 21:23:30 +0000 |
| Subject: | note 51359 added to features.commandline | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-87106@lists.php.net to get a copy of this message | ||
Example 43-2 shows how to create a DOS batch file to run a PHP script form the command line using:
@c:\php\cli\php.exe script.php %1 %2 %3 %4
Here is an updated version of the DOS batch file:
@c:\php\cli\php.exe %~n0.php %*
This will run a PHP file (i.e. script.php) with the same base file name (i.e. script) as the DOS
batch file (i.e. script.bat) and pass all parameters (not just the first four as in example 43-2)
from the DOS batch file to the PHP file.
This way all you have to do is copy/rename the DOS batch file to match the name of your PHP script
file without ever having to actually modify the contents of the DOS batch file to match the file
name of the PHP script.
----
Manual Page -- http://www.php.net/manual/en/features.commandline.php
Edit -- http://master.php.net/manage/user-notes.php?action=edit+51359
Delete: added to the manual -- http://master.php.net/manage/user-notes.php?action=delete+51359&report=yes&reason=added+to+the+manual
Delete: bad code -- http://master.php.net/manage/user-notes.php?action=delete+51359&report=yes&reason=bad+code
Delete: spam -- http://master.php.net/manage/user-notes.php?action=delete+51359&report=yes&reason=spam
Delete: useless -- http://master.php.net/manage/user-notes.php?action=delete+51359&report=yes&reason=useless
Delete: other reasons -- http://master.php.net/manage/user-notes.php?action=delete+51359&report=yes
Reject -- http://master.php.net/manage/user-notes.php?action=reject+51359&report=yes
Search -- http://master.php.net/manage/user-notes.php