我的ID是a5efa5
。PHP ereg_replace工作不正常
代碼如下替換棄用[?] [^a-z0-9]
不起作用。 a5efa5
在我的數據庫表中的一個id。
//Connect to the database through our include
include_once "database.php";
// Get the member id from the URL variable
$id = $_REQUEST['id'];
$id = ereg_replace("[^a-z0-9]", "", $id); // filter everything but numbers for security
if (!$id) {
echo "Missing Data to Run";
exit();
}
幫助我的朋友,在哪裏我犯了一個錯誤......
「*它不工作*」 是沒有用的。請解釋一下,如果你收到一條錯誤信息(如果是,哪一條)或者結果與你的期望有差異(如果是這樣,如何)。 –
你的問題是什麼。你期待什麼輸出..你能提供一個例子 –
從你的評論看來,你似乎只想避開數字。這是一個案子嗎?請解釋你期望從'a5efa5' id - 這個有效還是無效? – doc