Home  >  Article  >  Backend Development  >  php cli 小技能

php cli 小技能

WBOY
WBOYOriginal
2016-06-13 12:10:59816browse

php cli 小技巧

很简单,特别方便php做一些cli应用的调试和PHP模版?

?

源于:http://www.huiyi8.com/php/

1. [代码][PHP]代码 ? ??

var_dump($argv);

?

?

2. [代码][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

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