$email = "example@email.com"; if (filter_var($email, FILTER_VALIDATE_EMAIL)) { echo "Valid email address"; } else { echo "Invalid email address"; }
$url = "http://www.example.com"; if (filter_var($url, FILTER_VALIDATE_URL)) { echo "Valid URL"; } else { echo "Invalid URL"; }
$phone = "123-456-7890"; if (preg_match("/^[0-9]{3}-[0-9]{3}-[0-9]{4}$/", $phone)) { echo "Valid phone number"; } else { echo "Invalid phone number"; }The package library used in these examples is the built-in PHP functions for filtering and validating input data.