php cli 小技巧
编程学习 2021-07-05 09:49www.dzhlxh.cn编程入门
很简单,特别方便php做一些cli应用的调试,需要的朋友可以参考下
php代码:
<?php
var_dump($argv);
Shell/批处理代码
@echo off
:BEGIN
set /p input=any key to run or "c" exit:
if "%input%"=="c" goto END
goto RUN
:RUN
..\bin\php.exe -r "echo \"\r\n\r\n\";"
..\bin\php.exe run.php %input%
..\bin\php.exe -r "echo \"\r\n\r\n\";"
goto BEGIN
:END
exit
代码如下:
<?php
var_dump($argv);
Shell/批处理代码
代码如下:
@echo off
:BEGIN
set /p input=any key to run or "c" exit:
if "%input%"=="c" goto END
goto RUN
:RUN
..\bin\php.exe -r "echo \"\r\n\r\n\";"
..\bin\php.exe run.php %input%
..\bin\php.exe -r "echo \"\r\n\r\n\";"
goto BEGIN
:END
exit