How to implement foreach if?

How to make so: if in dB column = 1 foreach ..
I tried this:
<?php if(stripos($value['description'], '1') !== false) : foreach ($result as $value): ?>

but it doesn't work.

Any ideas?)
June 5th 19 at 21:05
1 answer
June 5th 19 at 21:07
https://ideone.com/xaKiG7

$value['description'] = 1;
$array = ['a', 'b', 'c'];

if($value['description'] == 1) { 

 foreach($array as $item) {
 echo $item;
}
}


php.net/manual/ru/control-structures.foreach.php

Find more questions by tags PHP