PHP数据流应用的一个简单实例

Cytheria ·
更新时间:2024-11-11
· 550 次阅读

代码如下:
<?php
$count = 5;
start:
if($count < 5) echo "You can try {$count} time, ";
echo "Put Password: ";
$handle = fopen ("php://stdin","r");
$line = fgets($handle);
if(trim($line) != '123456'){
$count--;
if(!$count) goto error;
goto start;
}
goto success;
error:
echo "Please try after 1 hour!";
goto out;
success:
echo "Logined!";
out:
?>

执行结果:



流应用 PHP

需要 登录 后方可回复, 如果你还没有账号请 注册新账号