I have this array:
Array
(
[0] => stdClass Object
(
[question_id] => 44
[question_name] => how to call javascript function in php
[question_type] => Single choice
[ttype_id] => 1
[marks] => 1
[pool_id] => 4
[deleted] => 0
[deleted_by] => 0
)
[1] => stdClass Object
(
[question_id] => 42
[question_name] => how to call recursive function
[question_type] => Single choice
[ttype_id] => 1
[marks] => 1
[pool_id] => 4
[deleted] => 0
[deleted_by] => 0
)
[2] => stdClass Object
(
[question_id] => 5
[question_name] => What is the correct way to end a PHP statement?
[question_type] => Single choice
[ttype_id] => 1
[marks] => 10
[pool_id] => 2
[deleted] => 0
[deleted_by] => 0
)
[3] => stdClass Object
(
[question_id] => 32
[question_name] => Who invented Copy, Paste?
[question_type] => Multiple choice
[ttype_id] => 1
[marks] => 5
[pool_id] => 1
[deleted] => 0
[deleted_by] => 1
)
[4] => stdClass Object
(
[question_id] => 32
[question_name] => Who invented Copy, Paste?
[question_type] => Multiple choice
[ttype_id] => 1
[marks] => 5
[pool_id] => 1
[deleted] => 0
[deleted_by] => 1
)
[5] => stdClass Object
(
[question_id] => 42
[question_name] => how to call recursive function
[question_type] => Single choice
[ttype_id] => 1
[marks] => 1
[pool_id] => 4
[deleted] => 0
[deleted_by] => 0
)
)
And I need to rearrange it by pool_id
sequence stored in another array as:
$pool_order = array(1,2,3,4,5);
So that this array is rearranged in this order. Any help?
I want this arrangement:
Array
(
[0] => stdClass Object
(
[question_id] => 32
[question_name] => Who invented Copy, Paste?
[question_type] => Multiple choice
[ttype_id] => 1
[marks] => 5
[pool_id] => 1
[deleted] => 0
[deleted_by] => 1
)
[1] => stdClass Object
(
[question_id] => 32
[question_name] => Who invented Copy, Paste?
[question_type] => Multiple choice
[ttype_id] => 1
[marks] => 5
[pool_id] => 1
[deleted] => 0
[deleted_by] => 1
)
[2] => stdClass Object
(
[question_id] => 5
[question_name] => What is the correct way to end a PHP statement?
[question_type] => Single choice
[ttype_id] => 1
[marks] => 10
[pool_id] => 2
[deleted] => 0
[deleted_by] => 0
)
[3] => stdClass Object
(
[question_id] => 44
[question_name] => how to call javascript function in php
[question_type] => Single choice
[ttype_id] => 1
[marks] => 1
[pool_id] => 4
[deleted] => 0
[deleted_by] => 0
)
[4] => stdClass Object
(
[question_id] => 42
[question_name] => how to call recursive function
[question_type] => Single choice
[ttype_id] => 1
[marks] => 1
[pool_id] => 4
[deleted] => 0
[deleted_by] => 0
)
[5] => stdClass Object
(
[question_id] => 42
[question_name] => how to call recursive function
[question_type] => Single choice
[ttype_id] => 1
[marks] => 1
[pool_id] => 4
[deleted] => 0
[deleted_by] => 0
)
)