Ver Mensaje Individual
  #1 (permalink)  
Antiguo 24/03/2012, 10:58
charlescuellar
 
Fecha de Ingreso: abril-2008
Mensajes: 310
Antigüedad: 16 años
Puntos: 4
como ordenar resultados con php

hola amigos tengo este codigo en donde extraigo los datos de mi lista de youtube
y tambien filtro el sustado con strpos , pero nesecito que este resultado de orderne de manera descende en donde el valor de la posicion es $position para cada item,


Código PHP:
Ver original
  1. <?php
  2.  
  3.  
  4.     // set feed URL
  5.     $feedURL = 'http://gdata.youtube.com/feeds/api/users/xxxx/playlists';
  6.    
  7.     // read feed into SimpleXML object
  8.     $sxml = simplexml_load_file($feedURL);
  9.    
  10.     // iterate over entries in feed
  11.  
  12.  
  13.     foreach ($sxml->entry as $entry) :
  14.       $titlecate = $entry->title;
  15.       $buscar = "parametro";
  16.  
  17. if( strpos( $titlecate, $buscar ) !== false ):
  18.         //if(eregi($buscar, $titlecate)) :
  19.  
  20.  
  21.    $titlecate = str_replace($buscar," ",$titlecate);
  22.  
  23.             // get nodes in media: namespace for media information
  24.         $media = $entry->children('http://search.yahoo.com/mrss/');
  25.    
  26.         // obtener <yt:playlistId> node    
  27.         $yt = $entry->children('http://gdata.youtube.com/schemas/2007');
  28.         $playlistId = $yt->playlistId;
  29.  
  30.  // get <yt:duration> node for video length
  31.       $yt = $media->children('http://gdata.youtube.com/schemas/2007');
  32.       $position = $yt->position;
  33.    
  34.         echo "<li>".html::link("index/categoria/$titlecate/$playlistId",$titlecate)."</li>";
  35.    
  36.      endif;
  37.  
  38.     endforeach;
  39.  
  40. ?>

espero me entiendan y colaboren
graicas