Skip to content

Instantly share code, notes, and snippets.

@tomschlick
Created January 23, 2011 11:38
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save tomschlick/792010 to your computer and use it in GitHub Desktop.
Save tomschlick/792010 to your computer and use it in GitHub Desktop.
<?php
$data = array(
array(
'info' => array(
'pet' => array(
'type' => 'dog'
)
),
),
array(
'info' => array(
'pet' => array(
'type' => 'fish'
)
),
),
array(
'info' => array(
'pet' => array(
'type' => 'cat'
)
),
),
);
$data = arr::sort($data, 'info.pet.type');
// Returns
array(
array(
'info' => array(
'pet' => array(
'type' => 'cat'
)
),
),
array(
'info' => array(
'pet' => array(
'type' => 'dog'
)
),
),
array(
'info' => array(
'pet' => array(
'type' => 'fish'
)
),
),
);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment