Why in_array
not work on array that create from loop php ?
this below code show Match found
.
<?php
for ($i = 0; $i < 10; ++$i) {
$people[] = $i;
}
if (in_array('test', $people))
{
echo "Match found";
}
else
{
echo "Match not found";
}
?>
and this below code show Match not found
.
<?php
$people = array("0","1","2","3","4","5","6","7","8","9");
if (in_array('test', $people))
{
echo "Match found";
}
else
{
echo "Match not found";
}
?>
How to solve first code to show Match not found