我發現了一個網站解釋使用pregmatch對這種表達,這是他們的部分代碼:驗證輸入數據時,test_input在pregmatch中的含義是什麼?
$name = test_input($_POST["name"]);
if (!preg_match("/^[a-zA-Z ]*$/",$name)) {
$nameErr = "Only letters and white space allowed";
}
是什麼意思test_input。我無處不在找它的意義。
我發現了一個網站解釋使用pregmatch對這種表達,這是他們的部分代碼:驗證輸入數據時,test_input在pregmatch中的含義是什麼?
$name = test_input($_POST["name"]);
if (!preg_match("/^[a-zA-Z ]*$/",$name)) {
$nameErr = "Only letters and white space allowed";
}
是什麼意思test_input。我無處不在找它的意義。
test_input
是什麼意思?
我到處找過它找不到它的含義。
如果它不在當前文件中,可能是其他地方的included。這可能是擴展的一部分。您可以使用get_extension_funcs()
檢查分機內的功能。
看到這個頁面:
PHP 5 Forms - Required Fields - w3schools.com example
function test_input($data) {
$data = trim($data);
$data = stripslashes($data);
$data = htmlspecialchars($data);
return $data;
}
這是一個用戶定義的函數。 – 2014-09-22 14:44:42
PHP函數的最佳參考是php手冊http://us2.php.net/manual-lookup.php?pattern=test_input&scope=quickref如果是谷歌,請使用搜索框。沒有幫助 – DirtyRedz 2014-09-22 14:48:35