[ Index ] |
|
Code source de e107 0.7.8 |
1 <?php 2 if (!defined('e107_INIT')) { exit; } 3 4 // Multi indice array sort by sweetland@whoadammit.com 5 if (!function_exists('asortbyindex')) { 6 function asortbyindex($sortarray, $index) { 7 $lastindex = count ($sortarray) - 1; 8 for ($subindex = 0; $subindex < $lastindex; $subindex++) { 9 $lastiteration = $lastindex - $subindex; 10 for ($iteration = 0; $iteration < $lastiteration; $iteration++) { 11 $nextchar = 0; 12 if (comesafter ($sortarray[$iteration][$index], $sortarray[$iteration + 1][$index])) { 13 $temp = $sortarray[$iteration]; 14 $sortarray[$iteration] = $sortarray[$iteration + 1]; 15 $sortarray[$iteration + 1] = $temp; 16 } 17 } 18 } 19 return ($sortarray); 20 } 21 } 22 23 if (!function_exists('comesafter')) { 24 function comesafter($s1, $s2) { 25 $order = 1; 26 if (strlen ($s1) > strlen ($s2)) { 27 $temp = $s1; 28 $s1 = $s2; 29 $s2 = $temp; 30 $order = 0; 31 } 32 for ($index = 0; $index < strlen ($s1); $index++) { 33 if ($s1[$index] > $s2[$index]) return ($order); 34 if ($s1[$index] < $s2[$index]) return (1 - $order); 35 } 36 return ($order); 37 } 38 } 39 ?>
titre
Description
Corps
titre
Description
Corps
titre
Description
Corps
titre
Corps
Généré le : Sun Apr 1 01:23:32 2007 | par Balluche grâce à PHPXref 0.7 |