Get webpage status code in php - Php

Webpage status code

Snippet Code


  
Rate this page :
  [ 0 votes]

When you call checkURL method it will return the status code for the corresponding webpage

function checkURL( $url ){ $ar=@get_headers($url); $str = explode(" ",$ar[0]); $sta=$str[1]; return $str[1]; }

Tags


Ask Questions

Ask Question