I want to add a space to some output after every 4th character until the end of the string. I tried:
$str = $rows[\'value\']; echo substr($str, 0, 4) . \'
The function wordwrap() basically does the same, however this should work as well.
wordwrap()
$newstr = ''; $len = strlen($str); for($i = 0; $i < $len; $i++) { $newstr.= $str[$i]; if (($i+1) % 4 == 0) { $newstr.= ' '; } }