bat executes php files

不言
Release: 2023-03-24 08:26:01
Original
3975 people have browsed it

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"  %*
Copy after login


1. The php file is:


<?php
    $rawParams = $_SERVER[&#39;argv&#39;];
    print_r($rawParams);
?>
Copy after login



cmd run 1.bat is:


   1.bat  22 33  44
Copy after login


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!

Related labels:
source:php.cn
Statement of this Website
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
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template