Open vbouchet31 opened 9 years ago
For example:
$my_array = array( 'key1' => array( 'sub_key' => array( 'sub_sub_key1' => 'value', ... ), ), 'key2' => array( 'sub_key' => array( 'sub_sub_key1' => 'another value', ... ), ), ); array_sort_by_nested_value($my_array, 'sub_key][sub_sub_key1');
This call should sort the nested array by using the value in [sub_key][sub_sub_key1] of each item. (With this example, keys order should be array_keys($my_array) = array('key2', 'key1);
array_keys($my_array) = array('key2', 'key1);
sounds like a recursive sort ?
Can you implement a pure PHP version and we can transform it into C language in extension?
For example:
This call should sort the nested array by using the value in [sub_key][sub_sub_key1] of each item. (With this example, keys order should be
array_keys($my_array) = array('key2', 'key1);