write a program to check the validity of an url in php code example Example: check if valid url php filter_var($url, FILTER_VALIDATE_URL);