为什么下面的代码:
if (isset($_GET['trainType']) && isset($_GET['onTime']) && isset($_GET['gotSeat'])) {
$train[0]['trainType'] = $_GET['trainType'];
$train[0]['trainType']['onTime'] = $_GET['onTime'];
$train[0]['trainType']['gotSeat'] = $_GET['gotSeat'];
echo '<pre>';
print_r($train);
echo '</pre>';
}
返回以下数组:
Array
(
[0] => Array
(
[trainType] => tLine
)
)
我最初认为它会返回更类似于此的内容:
Array
(
[0] => Array
(
[trainType] => 'passenger'
Array =>
(
[onTime] => true
[gotSeat] => true
)
)
)
关于我应该做什么来实现我想要做的任何指导?我希望我的代码使我想要做的事情变得明显。