URLの型チェック

filter_var: filter data by specified filter

$var="https://www.google.com/";
if(filter_var($var, FILTER_VALIDATE_URL)){
	echo $var . "正しいURL<br>";
} else {
	echo $var . "不正のURL<br>";
}