php change array of strings into paragraphs

Solutions on MaxInterview for php change array of strings into paragraphs by the best coders in the world

showing results for - "php change array of strings into paragraphs"
Luca
16 Oct 2018
1// array of strings.
2$terms = [
3'English consumer organisations and lawyers are seeing...',
4'',
5'Read more at EnglishNews.nl:'
6];
7
8// chnage them into paragraphs.
9$str = '';
10if(!empty($terms)) {
11    $str = '<p>' . implode("</p><p>", $terms) . '</p>';
12}
13
14print_r($str);