Re: RegEx -- help

From: Date: Fri, 10 Oct 2003 20:18:07 +0000
Subject: Re: RegEx -- help
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-165787@lists.php.net to get a copy of this message
On Fri, 10 Oct 2003 14:01:00 -0400 (EDT), Lists <lists@uc9.net> wrote:
I do not know if this is the right list, but if someone could help me with the following
Sure, I'll be glad to help.
I need a function that does this:
I'm not sure if you want me to write the code that does this for you, but I know that I wont. I'm just going to give you the tools that are commonly used for the tasks your asking for.
function phone($num) { take num and remove anything that is not a number ex: () - /
http://php.net/preg_replace
If there is not 1 at the start, add a one to the start of the number.
http://php.net/substr
make sure that the number is 10 digits (if not return -1)
http://php.net/strlen
} Thank you for your help,
In the future, please at least try and attempt to write the code, most people here arnt here to write code for everyone, but to solve problems people are having with their own code.

« previous php.general (#165787) next »