$idofdb = "25";
$myArray = array();
foreach ( $fthi as $codigo ) {
$myArray[] = $codigo['ImoCodigo'];
}
$checkValues = array_values($myArray);
$checkString = implode(',', $checkValues); // 3,4,5,6,7,8,9,10,11,12,13,18,19,14,15,2
I'd like to know how to compare $idofdb
with $checkString
to see if $idofdb
is registered in the database. As you can see, the output of $checkString
is a string of numbers separated by commas.