diff options
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; +} |
