diff options
| author | Horus3 | 2014-11-10 12:11:17 +0100 |
|---|---|---|
| committer | Horus3 | 2014-11-10 12:11:17 +0100 |
| commit | 771f805803f0cd67730ebbc7cb63e2312e4ca6c8 (patch) | |
| tree | ee537ecb393334e19dc9d7e589a2bb523ea37b17 /function.php | |
| download | httpheader-771f805803f0cd67730ebbc7cb63e2312e4ca6c8.tar.gz | |
init
Diffstat (limited to 'function.php')
| -rw-r--r-- | function.php | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/function.php b/function.php new file mode 100644 index 0000000..9d957a5 --- /dev/null +++ b/function.php @@ -0,0 +1,12 @@ +<?php + +function getHeader($url){ + $ch = curl_init($url); + curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); + curl_setopt($ch, CURLOPT_HEADER, 1); + + $response = curl_exec($ch); + $header_size = curl_getinfo($ch, CURLINFO_HEADER_SIZE); + $header = substr($response, 0, $header_size); + return $header; +} |
