I am trying to split / split an ongoing series of characters in a php string at a specific point e.g.
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
to
AAAAAAAAAAAAAAAAAAAA AAAAAAAAAAAAAAAAAAAA
PHP has a chunk_split() function that does exactly what you ask ...
chunk_split()
$myLongString = 'AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA'; $splitString = chunk_split($myLongString, 20); echo $splitString; /* AAAAAAAAAAAAAAAAAAAA AAAAAAAAAAAAAAAAAAAA */
I would use wordwrap () with the $ break parameter as "".
Just take a look at the substr function here ..
substr
eg:
substr('foobar', 0, 3). ' ';
gives
'foo '