Drupal 8 Valid_url()
Visit this to find an answer of this question.
https://drupaltreasure.blogspot.in/2017/04/drupal-8-validurl.html

The content of the provided link:


First, include class namespace use Drupal\Component\Utility\UrlHelper;
then use this function, No need to create the object because it is a static function so we can call it by its class name: UrlHelper::isValid($url, $absolute = FALSE);


Parameters:

$url : The URL to verify bool

$absolute: Whether the URL is absolute