Ver Mensaje Individual
  #2 (permalink)  
Antiguo 25/07/2009, 11:19
Avatar de abimaelrc
abimaelrc
Colaborador
 
Fecha de Ingreso: mayo-2009
Ubicación: En el planeta de Puerto Rico
Mensajes: 14.734
Antigüedad: 15 años
Puntos: 1517
Respuesta: Orderar arrays dependiendo de otro

Puedes hacerlo de esta forma
Código PHP:
Ver original
  1. <?php
  2. $fecha = array("02/08/2009", "06/08/2009", "05/08/2009", "04/08/2009", "25/08/2009","01/08/2009","02/09/2009");
  3. foreach($fecha as $v){
  4.     $eF = explode("/",$v);
  5.     $setFecha[] = strtotime($eF[2]."/".$eF[1]."/".$eF[0]);
  6. }
  7. natsort($setFecha);
  8. foreach($setFecha as $vv){
  9.     $fechaFinal[] = date("d/m/Y", $vv);
  10. }
  11. print_r($fechaFinal);
  12. ?>