/ Published in: PHP
Ordena Array Bidimensional Asociativo de acuerdo a parametro del array.
Expand |
Embed | Plain Text
Copy this code and paste it in your HTML
/* * Objetivo ordena un array dimensional */ function orderMultiDimensionalArray ($toOrderArray, $field, $inverse = false) { foreach ($toOrderArray as $key => $row) { $position[$key] = $row[$field]; $newRow[$key] = $row; } if ($inverse) { } else { } foreach ($position as $key => $pos) { $returnArray[] = $newRow[$key]; } return $returnArray; }