Longhorn PHP 2019 Schedule


Please answer this simple SPAM challenge: four minus two?
(Example: nine)

The Note You're Voting On

php at schabdach dot de
13 years ago
To pass more than 9 arguments to your php-script on Windows, you can use the 'shift'-command in a batch file. After using 'shift', %1 becomes %0, %2 becomes %1 and so on - so you can fetch argument 10 etc.

Here's an example - hopefully ready-to-use - batch file:

@echo off

set args=

if "%0"=="" goto :finish_arg
set args=%args% %0
goto :get_arg

set php=C:\path\to\php.exe
set ini=C:\path\to\php.ini
%php% -c %ini% foo.php %args%

Usage on commandline:
foo -1 -2 -3 -4 -5 -6 -7 -8 -9 -foo -bar

A print_r($argv) will give you all of the passed arguments.

<< Back to user notes page

To Top