I am having this array. Last few hours I have been trying to loop through and make another which will arrange the question in respective subjects.
[23] => Array
(
[right] => A list of station and network addresses with corresponding gateway IP address.
[id] => 23
[level] => Professional
[subject] => Array
(
[0] => Array
(
[tid] => 1
)
[1] => Array
(
[tid] => 6
)
)
[question] => What is an IP routing table?
[answer] => A list of host names and corresponding IP addresses.
[correct] => 0
)
[22] => Array
(
[right] => Session hijacking attack
[id] => 22
[level] => Professional
[subject] => Array
(
[0] => Array
(
[tid] => 1
)
[1] => Array
(
[tid] => 6
)
)
[question] => How would an IP spoofing attack be best classified?
[answer] => Session hijacking attack
[correct] => 1
)
[21] => Array
(
[right] => Repeater
[id] => 21
[level] => Intermediate
[subject] => Array
(
[0] => Array
(
[tid] => 1
)
[1] => Array
(
[tid] => 6
)
)
I want to make something like below.
array ( [tid1] => array (
[0] array ( [question] => something )
[1] array ( [question] => somethingelse )
)
[tid2] => array (
[0] array ( [question] => something )
[1] array ( [question] => somethingelse )
)
But I'm not able to do it. What is the best way to do this?