すべてのデータが経由で受信されたときにFALSEを返すには、どの検証コードを使用する必要がありますか
$ _GET ['group']、
$_GET['章']
$ _GET ['article']
$ laws [$ group] [$ chapter] [$ article]多次元配列がすでに設定されていると一致しませんか?
$ laws多次元配列で一度に1つの記事をエコーバックするつもりなので、そのような配列構造が存在しない場合はエラーが返されます。
どうもありがとう!
<?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];
?>