I will keep this brief, this is my code:
<?php
$arr = array(
1,
2,
3,
"x" => "aaa",
"y" => "bbb"
);
foreach($arr as $k => $v){
if($k !="y" && $k != "x") {
echo $v . " ";
}
}
?>
and this is the result:
2 3
and it acts as though this:
$example = 0;
if ($example == 'x' || $example == 'y') {
echo "true";
}
would echo out "true" instead of nothing.
Basically, my question is: why does it skip echo-ing out the first element of the array, if 0 does not equal "x" or "y"?