I want to check the registered users is student by validating the registered email. I have a table which contain multiple education email domain name such as @mmu.edu.my, @taylor.edu.uk and etc. First the controller should get all available name from database and validate the user email. Then will assign different roles according their university. But the question is how to check the email with each of the available domain name in database.
In my controller i had get the registered user email.
$user_email=$user_info->email;
This is example of the email
alex_9237502834@taylor.edu.uk
Is they any reference for me to learn how to validate?