I need to stop the operation of a particular piece of code. The exit, as far as die, stops the whole foreach code block.
I just need to stop inside the if, but keep running the foreach, then go back to those ifs, but do not run the first if
for example
foreach ($stmt->fetchAll() as $item => $value){
$this->return = '
<div class="form-group">
<div class="col-lg-12">
';
if($value->nome_categoria === 'USERS') {
$this->return .= 'USERS';
$this->achouUsers = true;
while (!$this->achouUsers){
continue;
}
}
if($value->nome_categoria === "OPTIONS"){
$this->return .= 'OPTIONS';
$this->achouUsers = true;
while (!$this->achouOptions){
continue;
}
}
if( $value->nome_categoria === "MFP E CONNECTOR" ){
$this->return .= 'MFP E CONNECTOR';
while (!$this->achouMDF){
continue;
}
}
$this->return .= '
</div>
<div class="col-lg-12">
<div class="col-lg-10">
<input type="radio" name="inputUsuarios">
'.utf8_encode($value->nome_item).'
'.(utf8_encode($value->nome_item) === 'Até' ? '<input type="text" > usuários <button class=" btn btn-warning"><i class="fa fa-calculator"></i> </button>' : '').'
</div>
<div class="col-lg-2 text-right">
'.number_format($value->valor_item,2,',','.').'
</div>
</div>
</div>
';
echo $this->return;
}
ran the USERS if only once. from that run everything, and continue running, but testing instead of USERS, but OPTIONS
EDITION 1
The expected result was something like
OPTIONS
Displayingthecategoryonlyonce,theUSERSontopofthatimage,theOPTIONSontopofthatimage,andsoon.Hepullingfromthebankbutonlyappearingonce.
Withthiscodemyreturnissomethinglike