search if values of an array are present on other array
<?php
$arr1=array("From","source","NT");
$os = array("Mac", "NT", "Irix", "Linux");
foreach($arr1 as $value){
if (in_array($value,$os)) {
echo "Found $value <br>";
}
else {
echo " Value $value not found<br>";
}
}
?>
<?php
function version
function removeheader($header,$arr) {
foreach($header as $value){
if (in_array($value,$arr)) {
echo "Found $value <br>";
}
else {
echo " Value $value not found<br>";
}
}
}
removeheader($arr1,$os);
?>
No hay comentarios:
Publicar un comentario