FILTER_VALIDATE_URL

Check whether the url is valid or not

Example
======

<?php
if(filter_var(“http://phpcodez.com”, FILTER_VALIDATE_URL)) {
echo “Valid URL”;
}else {
echo “Invalid URL”;
}
?>

Output
=====

Valid URL

Share

Leave a Reply

Your email address will not be published. Required fields are marked *