Hi Marc,

try this:

$string = preg_replace("/^41/", "0", $string);

http://www.php.net/preg_replace

/ and / = delimiters
^ = start of string (line in multiline mode)

So, it translates as, "replace a leading 41 in $string with 0".

..or try the ereg function, which has already been mentioned.

James


"Marc Bleuler" <[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> Hello all,
>
> 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....
>
> thank you very mutch for help
> Marc
>
>



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to