php change array of strings into paragraphs code example
Example: php change array of strings into paragraphs
// array of strings.
$terms = [
'English consumer organisations and lawyers are seeing...',
'',
'Read more at EnglishNews.nl:'
];
// chnage them into paragraphs.
$str = '';
if(!empty($terms)) {
$str = '<p>' . implode("</p><p>", $terms) . '</p>';
}
print_r($str);