I have two arrays. First contains variable names and second contains both float values and condition extracted from MySQL table with data type varchar. Now i want to use these names and values in if statement. Is it possible? Let me explaine the code.
for ($i=0; $i<5; $i++) {
if ($_POST[$names[$i]] $val[$i]) {
echo "Do something";
}
}
$names = array (name1, name2, name4 )
$val = array (<121.5, <=88.9, >77.3)
I want to perform logical comparison between these two and the comparison operators are stored with values in an array you can see. if it is not possible with if statement. kindly suggest me other method to do it. Thanks!