我應該使用什麼驗證碼,當通過與多維數組匹配形式的數據
$ _GET [「羣」],
$ _GET [「章」接收到的所有數據,返回FALSE ]
$ _GET [ '文章']
不與$規律[$ MATCH組] [$ chapter] [$ article]多維數組已經設置?
我問,因爲我打算一次回顯一篇文章中的$法則多維數組,如果這樣的數組構造不存在,則返回錯誤。
非常感謝!
<?php
session_start();
$laws = array(
"group1" => array(
"1" => array(
"1" => "This is article (1) in chapter (1) of (group1)",
"2" => "This is article (2) in chapter (1) of (group1)",
"3" => "This is article (3) in chapter (1) of (group1)",
),
"2" => array(
"1" => "This is article (1) in chapter (2) of (group1)",
"2" => "This is article (2) in chapter (2) of (group1)",
"3" => "This is article (3) in chapter (2) of (group1)",
),
),
"group2" => array(
"1" => array(
"1" => "This is article (1) in chapter (1) of (group2)",
"2" => "This is article (2) in chapter (1) of (group2)",
"3" => "This is article (3) in chapter (1) of (group2)",
),
"2" => array(
"1" => "This is article (1) in chapter (2) of (group2)",
"2" => "This is article (2) in chapter (2) of (group2)",
"3" => "This is article (3) in chapter (2) of (group2)",
),
)
);
$_SESSION['group'] = $_GET['group'];
$_SESSION['chapter'] = $_GET['chapter'];
$_SESSION['article'] = $_GET['article'];
$group = $_SESSION['group'];
$chapter = $_SESSION['chapter'];
$article = $_SESSION['article'];
// Echo Article from $laws multidimensional Array
echo $laws[$group][$chapter][$article];
?>
感謝您發佈您的標題。我正在墜入窒息,但現在我醒了。 – 2013-02-15 18:57:41