$numbers = array('1','2','3','4');
$number = '1';
有没有办法将所有数字与数字进行比较,以查看某些值是否等于$number?
是的,有:
if(in_array(1, array('1','2','3','4')))
{
echo 'It in here';
}else{ echo 'nope its not';}
$numbers = array('1','2','3','4');
$number = '1';
有没有办法将所有数字与数字进行比较,以查看某些值是否等于$number?
是的,有:
if(in_array(1, array('1','2','3','4')))
{
echo 'It in here';
}else{ echo 'nope its not';}