$string = \'Some string\';
$pos = 5;
...??...
$begging // == \'Some s\';
$end // == \'tring\';
What is the best way to separate string in two by
Wordwrap works better in my opinion.
$text = "The quick brown fox jumped over the lazy dog.";
$newtext = wordwrap($text, 20, "
\n");
echo $newtext;
The above example will output:
The quick brown fox
jumped over the lazy
dog.
Another example:
$text = "A very long woooooooooooord.";
$newtext = wordwrap($text, 8, "\n", true);
echo "$newtext\n";
The above example will output:
A very
long
wooooooo
ooooord.