So i'm trying to match the values from the database with values from an array.
This is the data from database
$verdeel = explode(", ", $data['product']);
$getallen = array("10", "20");
if(array_intersect($verdeel, $getallen)){
for($i=0;$i < count($verdeel);$i++){
if($verdeel[$i] == $getallen[$i]){
echo $getallen[$i];
} else {
echo "no match";
}
}
}
output will be now:
no match
no match
no match
no match
no match
I just want to only output the values of the array that match with some of the values in the database.
Thank you