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) . \'
PHP3 Compatible:
Try this:
$strLen = strlen( $str ); for($i = 0; $i < $strLen; $i += 4){ echo substr($str, $i, 4) . ' '; } unset( $strLen );