I am currently working on a function that needs to return a concatenated heredoc declaration. However, since my return statement is after my end delimiter I'm getting an error. For what it's worth, I have to concatenate the heredoc declaration to itself because I have loops and other logic in my function.
What is the proper way to do this? Sample code:
function trelloOutput($trello) {
$output = <<< OUTPUT
<div>some stuff here</div>
OUTPUT;
foreach($myloop as $loops) {
$j++;
$output .= <<< OUTPUT
<div> Looping stuff here $loops</div>
OUTPUT;
}
$output .= <<< OUTPUT
<div>more stuff</div>
OUTPUT;
return $output;
}