Reply
Preg_Match Help.
Old 05-04-2008, 08:23 PM Preg_Match Help.
Red_X_'s Avatar
Skilled Talker

Posts: 99
Location: USA
PHP Code:
preg_match('/^[0-9]{5}$/'trim(stripslashes($_POST['zip']))))

if (
preg_match("^[0-9]{3}-[0-9]{3}-[0-9]{4}$"trim(stripslashes($_POST['phone'])))) 
does anyone see anything wrong with those lines of codes.
__________________
>> Higher a poor college student. PM me :). PHP/MySQL <<
Red_X_ is offline
Reply With Quote
View Public Profile Visit Red_X_'s homepage!
 
When You Register, These Ads Go Away!
Old 05-04-2008, 09:56 PM Re: Preg_Match Help.
VirtuosiMedia's Avatar
Webmaster Talker

Posts: 735
The first line has one too many closing parentheses and no semicolon.
VirtuosiMedia is offline
Reply With Quote
View Public Profile Visit VirtuosiMedia's homepage!
 
Old 05-04-2008, 10:44 PM Re: Preg_Match Help.
Plugin-Developer's Avatar
Weightlifting CS Student

Posts: 505
Name: Nick Ohrn
The second line doesn't include the prefix and postfix delimiters:

PHP Code:
if (preg_match("/^[0-9]{3}-[0-9]{3}-[0-9]{4}$/"trim(stripslashes($_POST['phone'])))) 
__________________
Plugin-Developer.com - Custom plugin development to fit your needs. Plugins available for WordPress and Drupal, among others.
Plugin-Developer is offline
Reply With Quote
View Public Profile Visit Plugin-Developer's homepage!
 
Reply     « Reply to Preg_Match Help.
 

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off




   
RSS Feed  Feeds: RSS   JS   XML
RSS Feed  Feeds for this forum: RSS   JS   XML

 


Page generated in 0.12468 seconds with 12 queries