I have a foreach loop
It retrieves entries and displays based on whether there is anything in the field.
However now i need to display all those entries inside a HTML email and it wont let me do the normal way.
I have to generate one $value that outputs all of the loop so i can display the outputted HTML inside my email template.
Any help as to how i can get $allitems to equal something like this:
Go to sleep<br/>Wake up<br/>Make your bed
This is my code
$mydata= json_decode($row['bits']);
for ($x=1; $x<=9; $x++) {
$item = "item_$x";
if (isset($mydata->$item) && !empty($mydata->$item)) {
$items = '✔ '.$mydata->$item;
}
$allitems = explode("<br/>",$items);
}
AS i said the code works fine for every other purpose except when i need to collect the data and display inside my html generated email.
Thanks in advance, jonny