summaryrefslogtreecommitdiff
path: root/function.php
diff options
context:
space:
mode:
authorHorus32014-11-10 12:11:17 +0100
committerHorus32014-11-10 12:11:17 +0100
commit771f805803f0cd67730ebbc7cb63e2312e4ca6c8 (patch)
treeee537ecb393334e19dc9d7e589a2bb523ea37b17 /function.php
downloadhttpheader-771f805803f0cd67730ebbc7cb63e2312e4ca6c8.tar.gz
init
Diffstat (limited to 'function.php')
-rw-r--r--function.php12
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;
+}