<?php function mailKontrol($mail) { if ( filter_var($mail, FILTER_VALIDATE_EMAIL) ) { echo "Doğru email adresi"; } else { echo "Hatalı email adresi"; } } if($_POST){ mailKontrol($_POST["email"]); } ?> <form method="post" action=""> <input type="email" name="email"/> <button type="submit">Kontrol Et</button> </form>