亚洲国产日韩欧美一区二区三区,精品亚洲国产成人av在线,国产99视频精品免视看7,99国产精品久久久久久久成人热,欧美日韩亚洲国产综合乱

小案例:判斷輸入的字符串是不是PHP的關(guān)鍵字(key.php)

原創(chuàng) 2019-03-26 11:09:10 302
摘要:<?php$get = isset($_GET['in']) ? $_GET['in'] : '';$key = '__halt_compiler() abstract and array() as break callable case catch class clone const continue declare default
<?php
$get = isset($_GET['in']) ? $_GET['in'] : '';

$key = '__halt_compiler() abstract and array() as break callable case catch class clone const continue declare default die() do echo else elseif empty() enddeclare endfor endforeach endif endswitch endwhile eval() exit() extends final finally for foreach function global goto if implements include include_once instanceof insteadof interface isset() list() namespace new or print private protected public require require_once return static switch throw trait try unset() use var while xor yield';

$get = trim($get);
?>

<div>
<span style="color:red;">輸入PHP關(guān)鍵字:</span>
<form action="key.php" method='GET'>
<input type="text" name="in" id="">
<button style='color:red;'>提交</button>
</form>

</div>

<?php
if (!empty($get)) {
$get = strtolower($get);
if (strpos($key, $get)) {
echo "<span style='color:red;'>'{$get}' 是一個(gè)PHP關(guān)鍵字!</span>";
} else {
echo "<span style='color:red;'>輸入錯(cuò)誤,  '{$get}'  不是一個(gè)PHP關(guān)鍵字</span>";
}
}

?>


批改老師:查無此人批改時(shí)間:2019-03-26 16:51:08
老師總結(jié):這個(gè)不是讓你寫json數(shù)據(jù)嘛。怎么弄個(gè)字符串判斷。繼續(xù)加油吧。

發(fā)布手記

熱門詞條