Drupal 8 Valid_url() In Drupal 7 we use valid_url, but what is the replacement in Drupal 8 for it?
I tried it but it the function is undefined. Finally I found the solution, see my answer.
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