Ver Mensaje Individual
  #3 (permalink)  
Antiguo 09/08/2012, 09:01
Avatar de kimmy
kimmy
 
Fecha de Ingreso: julio-2008
Mensajes: 841
Antigüedad: 15 años, 9 meses
Puntos: 15
Respuesta: Determinar si valores de array existen en otro array

Gracias KsrZ. Las estuve viendo pero no entendi mucho (por mi poco conocimiento de ingles y falta de comprensión de la función en general). Por ejemplo esta:

Código PHP:
Ver original
  1. function recursiveArraySearchAll($haystack, $needle, $index = null)
  2. {
  3.     $aIt     = new RecursiveArrayIterator($haystack);
  4.     $it    = new RecursiveIteratorIterator($aIt);
  5.     $resultkeys;
  6.                        
  7.     while($it->valid()) {      
  8.     if (((isset($index) AND ($it->key() == $index)) OR (!isset($index))) AND (strpos($it->current(), $needle)!==false)) { //$it->current() == $needle
  9.     $resultkeys[]=$aIt->key(); //return $aIt->key();
  10.     }
  11.                            
  12.     $it->next();
  13.     }
  14.     return $resultkeys;  // return all finding in an array
  15.                        
  16. } ;
  17.  
  18. print_r(recursiveArraySearchAll($ciudades ,$archivo2,'[COLOR="Red"][B]your-array-index-to-search'[/B][/COLOR]) );

aqui 'your-array-index-to-search' no se que va

ni siquiera se si me sirve.

De verdad quiero aprender pero como si no entiendo ni papa
__________________
Caminando con el corazón partío