Raised This Month: $ Target: $400
 0% 

preg_match


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Author Message
reinert
Veteran Member
Join Date: Feb 2007
Old 09-25-2011 , 10:26   preg_match
Reply With Quote #1

How to check if the 'skype name' is correctly typed, and age ?

$skype_form = '/[^a-zA-Z0-9_-]/';
$age_form = '/^[0-9.-]$/';

I've tried those, but they does not work

for skype name I've tried: someone55
for age I've tried: 18

Didn't work.

EDIT: Found

$age_form = '/^[0-9]{1,2}$/'; Works, but now how to check is the age greater than 12 and lower than 50.
Got this:
if(!preg_match($age_form,$age)) {

ALSO I need Name checking [A-Z and a-z] Only

Last edited by reinert; 09-25-2011 at 10:48.
reinert is offline
 



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

Forum Jump


All times are GMT -4. The time now is 01:27.


Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Theme made by Freecode