Re: [PHP] adding a space every 4 chars

2004-11-11 Thread Jason Wong
On Friday 12 November 2004 04:49, Justin French wrote: What's the quickest way to add a space every four characters? Eg 123456789 becomes 1234 5678 9 No idea whether it's the quickest (in terms of cpu time): $doo = '123456789'; $dah = preg_replace('/(\d{4})/', '\\1 ', $doo); echo

[PHP] adding a space every 4 chars

2004-11-11 Thread Justin French
Hi, What's the quickest way to add a space every four characters? Eg 123456789 becomes 1234 5678 9 TIA, Justin -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP] adding a space every 4 chars

2004-11-11 Thread Justin French
On 13/11/2004, at 12:20 AM, Jason Wong wrote: No idea whether it's the quickest (in terms of cpu time): $doo = '123456789'; $dah = preg_replace('/(\d{4})/', '\\1 ', $doo); echo $dah; Quickest for me is more about lines of code and simplicity, so, thanks!! Justin -- PHP General Mailing