<?php
//check_email.php
if ( !( function_exists ( 'str_starts_with' ) ) ){
function str_starts_with ( $haystack , $needle ) {
return substr_compare ( $haystack , $needle , 0 , strlen ( $needle ) ) === 0 ;
}
}
if (!( function_exists ( 'str_ends_with' ) )) {
function str_ends_with ( $haystack , $needle ) {
return substr_compare ( $haystack , $needle , - strlen ( $needle ) ) === 0 ;
}
}
//Check if input email is Company email address
function check_email( $email )
{
$email=strtolower($email);
if( str_ends_with( $email , '@126.com' ) || str_ends_with( $email , '@163.com' ))
{
return true;
}
else
{
return false;
}
}