Skip to content
Create a gist now

Instantly share code, notes, and snippets.

anonymous /gist:6462971
Created Sep 6, 2013

$dataArray = array();
$data = array(
'Offer' => array('id' => 2, 'name' => 'ExampleName'),
'Stat' => array('Stat1' => 1, 'Stat2' => 2),
'Country' => array('Name' => array('z','name2'))
);
array_push($dataArray,$data);
$data = array(
'Offer' => array('id' => 2, 'name' => 'ExampleName'),
'Stat' => array('Stat1' => 1, 'Stat2' => 3),
'Country' => array('Name' => array('a','name2'))
);
array_push($dataArray,$data);
print_r(Set::sort($dataArray,'{n}.Country.Name','asc'));
/* Array (
[0] => Array (
[Offer] => Array (
[id] => 2
[name] => ExampleName
)
[Stat] => Array (
[Stat1] => 1
[Stat2] => 3
)
[Country] => Array (
[Name] => Array (
[0] => a
[1] => name2
)
)
)
[1] => Array (
[Offer] => Array (
[id] => 2
[name] => ExampleName
)
[Stat] => Array (
[Stat1] => 1
[Stat2] => 2
)
[Country] => Array (
[Name] => Array (
[0] => z
[1] => name2
)
)
)
)*/
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.