/ Published in: PHP

Ordena alfabéticamente el array $friends['data'] obtenido con la api de facebook.
Expand |
Embed | Plain Text
Copy this code and paste it in your HTML
//FUNCION QUE ORDENA function sortBySubkey(&$array, $subkey, $sortType = SORT_ASC) { foreach ($array as $subarray) { $keys[] = $subarray[$subkey]; } } //VARIABLE QUE RESCATA A LOS AMIGOS (LOS CAMPOS QUE SE ENCUENTRAN EN ESTE ARRAY SON ID Y NAME) $fls = $friends['data']; //ORDENO el array $fls sortBySubkey($fls, 'name');
Comments
