
01/09/2008, 13:06
|
| | Fecha de Ingreso: enero-2004
Mensajes: 28
Antigüedad: 21 años, 1 mes Puntos: 1 | |
Respuesta: array multidimensionales Por ahi esto te puede servir...otro ejemplo de php.net
<?php
function array_search_recursive($needle, $haystack, $a=0, $nodes_temp=array()){
global $nodes_found;
$a++;
foreach ($haystack as $key1=>$value1) {
$nodes_temp[$a] = $key1;
if (is_array($value1)){
array_search_recursive($needle, $value1, $a, $nodes_temp);
}
else if ($value1 === $needle){
$nodes_found[] = $nodes_temp[$a];
}
}
return $nodes_found;
}
$array_multi = array(array("0"=>"AA","1"=>"BB"),array("2"=>"CC"," 3"=>"DD"),array("4"=>"AA","5"=>"EE"));
if (is_array((array_search_recursive("AA",$array_mult i))))
echo "Texto encontrado";
else
echo "Texto no encontrado";
<? |