<?php $strings = [ "test@test.edu", "test@test.edu.pl", "test@test.com", "test.edu@test.com" ]; foreach ($strings as $string) { if (in_array("edu", explode(".", explode("@", $string)[1]))) { echo "$string contains .edu after @" . PHP_EOL; } else { echo "$string dot not contain .edu after @" . PHP_EOL;; } }
You have javascript disabled. You will not be able to edit any code.