Re: adding a space every 4 chars
| From: | Justin French | Date: | Fri, 12 Nov 2004 05:20:17 +0000 |
| Subject: | Re: adding a space every 4 chars | ||
| References: | 1 2 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-201818@lists.php.net to get a copy of this message | ||
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