<?php
$input = '5' ;
$id = array(1,2,3,4,5,6,7);
How to match if $input is in $id ? How to do something if it is false (No match), like if $input='10' echo No match?
<?php
$input = '5' ;
$id = array(1,2,3,4,5,6,7);
How to match if $input is in $id ? How to do something if it is false (No match), like if $input='10' echo No match?
To check if value is contained in array, you can use native PHP function in_array()
if(in_array($input, $id)){
echo 'Match';
}else{
echo 'No match';
}