Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

parse string

Status
Not open for further replies.

riffy

Programmer
Mar 29, 2001
106
US
hey everyone,

i wanted to know whether it's possible to take a phone number in this format:

123-123-1234

and parse it into this:
123
123
1234

thanks
arif
 
you can get as simple as:

$array=explode("-",$phone);

then you have an indexed array with the 3 parts of the phone number

$array[0] have the first token.
$array[1] the second
and $array[2] have the 3rd.
and so on.

Anikin
Hugo Alexandre Dias
Web-Programmer
anikin_jedi@hotmail.com
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top