Order Multidimensional Arrays PHP

Posted by ronsandova on Stack Overflow See other posts from Stack Overflow or by ronsandova
Published on 2010-04-07T00:43:45Z Indexed on 2010/04/07 0:53 UTC
Read the original article Hit count: 324

Hi everyone

I have some problem to order an array by a field of this, here i leave the example

foreach($xml as $site){
echo '<div><a href="'.$site->loc.'">'.$site->loc.'</a>' .$site->padre.'</div>';
}

Some times the filed $site->padre is empty but i'd like to order by $site->padre alphabetical i saw example with usort but i don't understand how to work it.

Thanks in advance.

Cheers

© Stack Overflow or respective owner

Related posts about php

Related posts about arrays