I have a foreach inside another foreach that will rotate by several values of a specific object. But I need to stop both foreach's when it goes into if, but the break
command does not work for some reason, it just keeps running both foreach's. The code looks something like this:
foreach($conteudo["data"] as $oddss) {
foreach($oddss["types"]["data"] as $oddss2) {
if($oddss2["type"] == "1x2") {
$bookmarker = $oddss["bookmaker_id"];
foreach($oddss2["odds"]["data"] as $oli) {
switch($oli["label"]) {
case 1:
$cotCasa = $oli["value"];
break;
case 2:
$cotFora = $oli["value"];
break;
case "X":
$cotEmp = $oli["value"];
}
}
break;
}
}
}