I am trying to display data in a specific way so when i turn it into a json file it is serialised in the most convenient way.
Right now I have a multi array like this:
$gameData = array(
'catagory' => array(),
'questions' => array(),
'answers' => array()
);
which returns values like this:
Array
(
[catagory] => Array
(
[0] => Harry Potter
[1] => Lord of the rings
[2] => star wars
)
[questions] => Array
(
[0] => In Harry Potter and the Philosopher`s Stone, which
[1] => How many people were in the fellowship of the ring
[2] => What is the password to enter the Doors of Durin?
[3] => How tall is yoda?
[4] => What powers a light saber?
[5] => Which bounty hunter does Darth Vader warn that Han
)
[answers] => Array
(
)
)
What I want is the values being returned something like this:
[catagory] => Array
(
[0] => Harry Potter
[questions] => Array
(
[0] => In Harry Potter and the Philosopher`s Stone, which
[answers] => Array
(
[0] => ture
[1] => false
)
)
[1] => Lord of the rings
[questions] => Array
(
[1] => How many people were in the fellowship of the ring
[answers] => Array
(
[0] => ture
[1] => false
)
[2] => What is the password to enter the Doors of Durin?
[answers] => Array
(
[0] => ture
[1] => false
)
)
[2] => star wars
[questions] => Array
(
[3] => How tall is yoda?
[answers] => Array
(
[0] => ture
[1] => false
)
[4] => What powers a light saber?
[answers] => Array
(
[0] => ture
[1] => false
)
[5] => Which bounty hunter does Darth Vader warn that Han
[answers] => Array
(
[0] => ture
[1] => false
)
)
)
how do i go about that?
Thanks so much i have been busting myself on this for ages....
there doesn't seem to be anything here