Please I am trying to write a function that will enable me split long text in a textarea into multi lines using something similar to php wordwrap function. How ever I need the result in foreach arrays so i can bind the result to my GD Image code so that long text area broken line my line.
Below is the echo wordwrap function I use to break the text into lines. How ever now I would love to explode the string based on php wordwrap into arrays. Thank you
<?php
$str = 'Long Text with line breaks, line 1, Line 2, Line 3' ;
echo wordwrap($str,25,"<br>n");
?>
I am trying to achieve the following below
Array
(
[0] => Long Text with line breaks
[1] => Line 1
[2] => Line 2
[3] => Line 3
)