This article mainly introduces bat to execute php files, which has certain reference value. Now I share it with everyone. Friends in need can refer to it
1.bat file content is:
%~dp0: The directory where the 1.bat file is located
%*: The parameters passed
set curDerectory=%~dp0 php.exe "%curDerectory%1.php" %*
1. The php file is:
<?php $rawParams = $_SERVER['argv']; print_r($rawParams); ?>
cmd run 1.bat is:
1.bat 22 33 44
The output is:
Related recommendations:
PHP execution program php.exe parameter analysis
About the method of executing php statements in static html files
The above is the detailed content of bat executes php files. For more information, please follow other related articles on the PHP Chinese website!