The <<<
syntax is a multi-line string format. Everything inside the block is part of a string. You cannot have any PHP code in there.
If you need to have a looped block in there, you would need to generate that string before the <<<
block as a variable, and include it in the string that way.
$ins = '';
foreach($myarray as $val) {$ins .= "blah, {$val}, etc, ";}
$variable = <<
(Я также хотел бы отметить, что в простом примере, который вы указали, foreach()
может так же легко использовать implode()
)