Skip to content

Commit 14aef29

Browse files
authored
Detect 404 page and return false value(bool)...
1 parent f38bff9 commit 14aef29

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

NetPHP.php

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -81,6 +81,10 @@ function post($url,$values,$headers=[],$reffer="",$auto_redirect=true) {
8181
print_r($body);
8282
print "\n";
8383
}
84+
$httpCode = curl_getinfo($curl,CURLINFO_HTTP_CODE);
85+
if($httpCode == 404) {
86+
return false;
87+
}
8488
return [$body,$header];
8589
}
8690
function get($url,$headers=[],$reffer="",$auto_redirect=true)
@@ -128,6 +132,10 @@ function get($url,$headers=[],$reffer="",$auto_redirect=true)
128132
print_r($body);
129133
print "\n";
130134
}
135+
$httpCode = curl_getinfo($curl,CURLINFO_HTTP_CODE);
136+
if($httpCode == 404) {
137+
return false;
138+
}
131139
return [$body,$header];
132140
}
133141
////////////////////////////////////////////////////////

0 commit comments

Comments
 (0)