<?php
$email = "мояпочта@домен.рф";
echo filter_var($email, FILTER_VALIDATE_EMAIL) ? $email . " valid\n" : $email . " not valid\n";
$url = 'http://example.com/"><script>alert(document.cookie)</script>';
echo filter_var($url, FILTER_VALIDATE_URL) ? $url . " valid\n" : $url . " not valid\n";
?>