You wrote:
> I have a simple question...
> How can a space inserted to a string after the 3rd char ??
>
> washington ->> was hington
$str = 'washington';
$str = ereg_replace('^(.{3})(.*)$', '\\1 \\2', $str);
--
-Ryan :: ICQ - 595003 :: GigaBoard - http://www.gigaboard.net/
--
PHP Gene
Maybe something like:
$word="washington";
$length=strlen($word);
$a=substr($word,0,3);
$b=substr($word,3,$length-3);
$string=$a." ".$b;
print $string;
you might want to test for the length of $word first
to make sure $word has more than 3 characters
--- Andras Kende <[EMAIL PROTECTED]> wrot
Hi,
I have a simple question...
How can a space inserted to a string after the 3rd char ??
washington ->> was hington
Thanks :)
Andras
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To cont
3 matches
Mail list logo