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

  • anup: thanx it helped me alot…
  • admin: try to look at window.location function of Javascript and place it under the success function of the AJAX...
  • ana: it works for me, but after success, how can i forward the url to a certain page? thanks
  • admin: Hello Don, do these steps again and again until the PSP reboots. Restore your PSP’s Default settings in SYstem...
  • don sb: my psp was already hacked then i changed the screen cos it broke,so at one point the battery lost total...