Last active
December 31, 2015 04:49
-
-
Save aledjones/7936299 to your computer and use it in GitHub Desktop.
HTTP-Response-Codes “tres chic” in PHP als String auslesen.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
// Response-Header auslesen | |
$headers = get_headers("https://jonasmoeller.de/"); | |
$code = substr($headers[0], 9, 3); | |
^ ^ ^ | |
gehe zum ersten String -| | | | |
| | | |
setzte Start-Position ------| | | |
| | |
setzte auszuloesende Menge ----| | |
echo $code; // wäre dem zufolge: 200 | |
?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment