Search Keyword:

29Jul

Simple email address validation function - PHP

Posted by admin as PHP

This is a simple email address validation function written in PHP.It can be used in signup forms to validate email entries on form.Email address validation function will return 1 if it is valid and 0 if it is not.

function check_email($str)
{
//returns 1 if valid email, 0 if not
if(ereg(”^.+@.+\\..+$”, $str))
return 1;
else
return 0;
}

  • Digg
  • del.icio.us
  • Tumblr
  • StumbleUpon
  • Technorati
  • Reddit
  • NewsVine
  • Slashdot
  • DZone
  • Facebook
  • Twitter

2 Responses to Simple email address validation function - PHP

bon

August 11th, 2009 at 8:36 am

brod is this only the simple code use for submitting email?

admin

August 11th, 2009 at 11:04 am

hello Mark,that piece of code is just for email validation,not for submitting email.Thanks!

Comment Form

Sponsored Links



Recent Comments

  • Musta: Very good tutorial for beginners who want to get an idea of the ajax implemtation via jquery. Thanx
  • admin: Hello Mous, Kindly look at this link: http://www.ryantetek.com/2009/ 10/how-to-hack-psp-brite-30...
  • mous: Sir pls help.. i have a psp 3000 with firmware 5.02 i tried the instructions above and it wont work on me.. it...
  • milo: i think the quick solution is to have the pagination in ajax otherwise it wont work as expected im not sure...
  • admin: Hello Milo, I haven’t tried it with pagination before.Maybe I’ll take a look at it and post some...