Tycoon Talk
Become a Big fish!
The number 1 forum for online business!
Post topics, ask questions, share your knowledge.
Tycoon Talk is part of Freelancer.com - find skilled workers online at a fraction of the cost.

PHP Forum


You are currently viewing our PHP Forum as a guest. Please register to participate.
Login



Freelance Jobs

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

Posts: 153
Location: Houston
Trades: 0
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.
__________________
"Good News Everyone, by reading this your hearing my voice."
Red_X_ is offline
Reply With Quote
View Public Profile Visit Red_X_'s homepage!
 
 
Register now for full access!
Old 05-04-2008, 10:56 PM Re: Preg_Match Help.
VirtuosiMedia's Avatar
Web Design Made Simple

Posts: 1,228
Trades: 0
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, 11:44 PM Re: Preg_Match Help.
Plugin-Developer's Avatar
Weightlifting CS Student

Posts: 504
Name: Nick Ohrn
Trades: 0
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'])))) 
__________________

Please login or register to view this content. Registration is FREE
- 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 Search this Thread
Search this Thread:

Advanced Search

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

BB 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.11398 seconds with 12 queries