I currently have my code to output data from a database but I am unsure of how to append text during a foreach where the result is not the final entry.
//Print each result
foreach($new_array as $array){
//print out a result with formatting
Echo $Content1 = <<<CONTENT1
{"
CONTENT1;
Echo $array['f1'];
Echo $Content2 = <<<CONTENT2
"}{"
CONTENT2;
Echo $array['f2'];
Echo ".";
Echo $array['f3'];
Echo $Content3 = <<<CONTENT3
"}
CONTENT3;
Echo ", " //If not final entry
};
?>
So in short transforming the output from;
{"Entry"}{"Name.ID"}{"Entry"}{"Name.ID"}
to;
{"Entry"}{"Name.ID"}, {"Entry"}{"Name.ID"}