Skip to content

Commit

Permalink
Detect 404 page and return false value(bool)...
Browse files Browse the repository at this point in the history
  • Loading branch information
BaseMax authored Aug 17, 2019
1 parent f38bff9 commit 14aef29
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions NetPHP.php
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,10 @@ function post($url,$values,$headers=[],$reffer="",$auto_redirect=true) {
print_r($body);
print "\n";
}
$httpCode = curl_getinfo($curl,CURLINFO_HTTP_CODE);
if($httpCode == 404) {
return false;
}
return [$body,$header];
}
function get($url,$headers=[],$reffer="",$auto_redirect=true)
Expand Down Expand Up @@ -128,6 +132,10 @@ function get($url,$headers=[],$reffer="",$auto_redirect=true)
print_r($body);
print "\n";
}
$httpCode = curl_getinfo($curl,CURLINFO_HTTP_CODE);
if($httpCode == 404) {
return false;
}
return [$body,$header];
}
////////////////////////////////////////////////////////
Expand Down

0 comments on commit 14aef29

Please sign in to comment.