foreach ($tables as $key => $value) {
if ($value['id'] == $id) {
$s = 2;
break;
}else
{
$s = 0;
}
}
echo $s;
$s = 0;
foreach ($tables as $value) {
if ($value['id'] == $id) {
$s = 2;
}
}
echo $s;
$s = 0;
foreach ($tables as $key => $value) {
if () {
$s = 2;
} else {
$s = 1;
}
}