Re: replace digits
| From: | mnc at stoic dot net | Date: | Tue, 19 Mar 2002 07:29:53 +0000 |
| Subject: | Re: replace digits | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-89075@lists.php.net to get a copy of this message | ||
On Mon, 18 Mar 2002, Marc Bleuler wrote:
> Im trying to replace the first two digits (41) from a telephone no. with a 0
> (zero), like 41763334455 should end wit 0763334455. Anybody a idea howto? My
> php programming experiance is not very high so if any body could provide a
> code example....
http://www.php.net/manual/en/function.ereg-replace.php
$new_number = ereg_replace('^41', '0', $old_number);
miguel