Why does the following code:
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>';
}
Return the following array:
Array
(
[0] => Array
(
[trainType] => tLine
)
)
I had initially assumed it would return something more resembling to this:
Array
(
[0] => Array
(
[trainType] => 'passenger'
Array =>
(
[onTime] => true
[gotSeat] => true
)
)
)
Any guidance on what I should do to achieve what I am trying to do? I am hoping that my code makes what I am trying to do obvious.
trainType = string 'VLine' (length=5) onTime = string 'true' (length=4) gotSeat = string 'true' (length=4)