$arr['a']['studentname'] = "john";
$arr['b']['studentname'] = "stefen";
$arr['c']['studentname'] = "alex";
is it possible to sort using user defined functions:
usort( $arr )
uasort( $arr )
uksort( $arr )
so based on value which i need to pass, the array should be sorted! expected output:
if the current value then
Array
(
[c] => Array
(
[studentname] => alex
)
[a] => Array
(
[studentname] => john
)
[b] => Array
(
[studentname] => stefen
)
)
if the current value then
Array
(
[b] => Array
(
[studentname] => stefen
)
[a] => Array
(
[studentname] => john
)
[c] => Array
(
[studentname] => alex
)
)
thanks in advance