Home  >  Article  >  Backend Development  >  bat executes php files

bat executes php files

不言
不言Original
2018-04-17 14:39:473974browse

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[&#39;argv&#39;];
    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

How to execute PHP scripts?




The above is the detailed content of bat executes php files. For more information, please follow other related articles on the PHP Chinese website!

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn