Проверяю пользовательское значение через данные, сохраненные в массиве, но даже если совпадает оно не выполняется
Вот код
$groups = [
"power-group" => ["pump", "abs-bums", "super-strong", "fitball", "fit-cross", "body-sculpt", "lab", "hell-scretch", "witch-ball", "body-pump", "abs"],
"static-group" => ["mfr", "healthy-back", "pilates", "twine-school", "yoga", "open-day", "lfk-50", "yoga-in-gamake", "interval"],
"aerobics-group" => ["joint-gymnastics", "press-stretch", "abs-stretch", "joint-gymnastics-stretch", "abl", "make-body", "mobility", "stretch"],
"dance-group" => ["latina", "tabata", "aerobics", "fitness-dance", "latina-start", "latina-pro"]
];
$group = "null";
foreach($groups as $key => $value)
{
for($i = 0; $i < count($groups[$key]); $i++)
{
echo $groups[$key][$i] . " = " . $trainings[1] . '<br />';
if($groups[$key][$i] == $trainings[1])
{
$group = "sport";
goto contin;
}
}
}
contin:
$record = $connection->query("SELECT * FROM `$calendar` WHERE `title` = '$week'");
$record = $record->fetch();
Вот результат цикла: