<?php
class valid {
function email($emailaddress) {
preg_match_all("|[a-zA-Z0-9](.*)@[a-zA-Z0-9](.*)\.[a-zA-Z0-9](.*)|",$emailaddress,$out,PREG_SET_ORDER);
if(!is_array($out)) {
return 0;
}
if(!is_array($out[0])) {
return 0;
}
if(sizeof($out[0]) < 4) {
return 0;
}
return 1;
} // end of the string function
}
?>