Programming, website development forum Get latest updates by RSS Follow TechnicalTalk on Twitter Follow TechnicalTalk on Facebook 
HomeSearchRecent PostsLoginRegisterContact Us

Username  
Password    
  Forgot your password?  

Pages: [1]   Go Down
 
  Email this topic  |  Print
0 Members and 1 Guest are viewing this topic.

Php preg_replace form validation?

 
webmaster forum
singam  Offline
Activity
0%
 
Regular Coder
Posts: 50
Topics: 19
June 23, 2010, 02:13:53 AM


im trying to use preg_replace to output the following situations.
only letters
only numbers
only letters and numbers
only letters numbers periods and commas

im trying also trim all white spaces, i guess i can use trim() unless there is a way i can use regex to trim all down in one function.

so far i got only numbers down
preg_replace("#[^0-9]#i",' ',$var)

____________________________________________________________
 Hotel Italy  |  Apartments Italy
 
webmaster forum
U_Blog  Offline
Activity
0%
 
New Coder
Age: 23
Posts: 39
Topics: 1
WWW
October 12, 2011, 10:46:00 PM

hmm thats nice..

Get a Free Blog
Get a Blog
 
  Email this topic  |  Print
Pages: [1]   Go Up
 
Jump to:  



Powered by SMF 1.1.15 | SMF © 2011, Simple Machines


Google visited last this page February 05, 2012, 10:13:50 AM