...

View Full Version : Regular Expressions



m@l@y@
11-09-2006, 09:55 AM
Hi I need help on regular expressions:. I need to know how to manipulate the telephone data on the form. e.g. if the user inserts, (012)7993456.

kehers
11-09-2006, 10:23 AM
Explain wat u mean by the term manipulate

kaisellgren
11-09-2006, 03:57 PM
Yes, exactly. You need to be more specific...

Here a sample to get the country code:

preg_match("/\\(\d+\\)/",$text,$matches);
echo $matches[0]; // Echoes 012 in your case



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum