Mailinglisten-Archive |
das sollte dir weiterhelfen !
function is_in_array($array,$string) {
if(is_array($array)==1 AND is_string($string)==1) {
for($i=0;$i<count($array);$i++)
if($string == $array[$i]) { return true; }
}
}else { echo "Array is not an array or the string is not a string";
exit; }
}
function array_in_array($array1,$array2) {
if(is_array($array1)==1 AND is_array($array2)==1) {
$array_result = array();
for ($i=0;$i<count($array1);$i++) {
for ($j=0;$j<count($array2);$j++) {
if($array1[$i]==$array2[$j]) {
$array_result[] = $array1[$i];
}
}
}
return $array_result;
} else {echo "Please be sure that you have two arrays !"; exit;}
}//endmainfnc
php::bar PHP Wiki - Listenarchive