Welcome to collectivesolver - Programming & Software Q&A with code examples. A website with trusted programming answers. All programs are tested and work.

Contact: aviboots(AT)netvision.net.il

Buy a domain name - Register cheap domain names from $0.99 - Namecheap

Scalable Hosting That Grows With You

Secure & Reliable Web Hosting, Free Domain, Free SSL, 1-Click WordPress Install, Expert 24/7 Support

Semrush - keyword research tool

Boost your online presence with premium web hosting and servers

Disclosure: My content contains affiliate links.

39,859 questions

51,780 answers

573 users

How to fetch and print all HTTP request headers in PHP

1 Answer

0 votes
foreach (getallheaders() as $name => $value) 
    echo "$name: $value <br />";



/*
run:

Cookie: DBGSESSID=; __atuvc=26%7C25 
User-Agent: Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 6.1; ...
Connection: Keep-Alive 
Host: localhost:8080
Accept-Language: he-IL 
Accept-Encoding: gzip, deflate 
Accept: application/x-ms-application, image/jpeg, application/xaml+xml, ...

*/

 



answered Jun 22, 2016 by avibootz
edited Jun 23, 2016 by avibootz

Related questions

1 answer 218 views
1 answer 100 views
1 answer 109 views
...