Ver Mensaje Individual
  #3 (permalink)  
Antiguo 24/03/2010, 17:29
Avatar de spider_boy
spider_boy
 
Fecha de Ingreso: diciembre-2003
Ubicación: Chile
Mensajes: 1.855
Antigüedad: 20 años, 5 meses
Puntos: 89
Respuesta: filtrar arrayL

No se enojen

Código PHP:
Ver original
  1. $arr = array(
  2.       'http://www.programas-gratis.net/b/luna-royale',
  3.       'http://www.programas-gratis.net/b/fases-de-la-luna-1.1',
  4.       'http://dios-de-la-guerra.programas-gratis.net',
  5.       'http://grand-theft-auto-4.programas-gratis.net',
  6.       'http://resident-evil.programas-gratis.net',
  7.       'http://medal-of-honor-wallpaper.programas-gratis.net',
  8.       'http://los-sims-3.programas-gratis.net',
  9.       'http://need-for-speed-shift-mclarenf1.programas-gratis.net'
  10. );
  11. function filtrar($elem) {
  12.     $preg = "#^(http://(?!www\.)([a-zA-Z0-9\/\-\.net])+)$#";
  13.     if(preg_match($preg, $elem, $m)) {
  14.         return $m[0];
  15.     }
  16. }
  17. $new_arr = array();
  18. $new_arr = array_filter($arr, 'filtrar');
  19. print_r($new_arr);
__________________
Nunca te olvidaré mi negra hermosa. Te extraño demasiado.