bat 实现dos选择执行相应的内容

1.bat:

@echo off
@set curDerectory=%~dp0
php.exe "%curDerectory%1.php" 

1.php:

<?php
$arr = ['dev','pro'];
foreach($arr as $i=>$v){
   echo "[$i] $v \n";
}
echo "\n  Your choice [0-" . (count($arr) - 1) . ', or "q" to quit] ';
$answer = trim(fgets(STDIN));
if(!empty($arr[$answer])){
	echo $arr[$answer];
}
?>

执行结果:



阅读更多
想对作者说点什么? 我来说一句

没有更多推荐了,返回首页