Processing the URL starts from the form fields by using the url input type. But in some cases, this does not work well, so we need to validate the URL before processing to make sure that the entry is valid.

<?php
$str = 'http://yourwebtech.info';
if( filter_var($str, FILTER_VALIDATE_URL, FILTER_FLAG_HOST_REQUIRED) !== false ) {
    echo 'URL is valid';
}

Or by using it in a function

<?php
function is_valid_url($str) {
    if( filter_var($str, FILTER_VALIDATE_URL, FILTER_FLAG_HOST_REQUIRED) === false ) {
        return false;
    }
    return true;
}

if( is_valid_url('http://yourwebtech.info') ) {
    echo 'URL is valid';
}