undefined index 3a http host

Solutions on MaxInterview for undefined index 3a http host by the best coders in the world

showing results for - "undefined index 3a http host"
Francesca
07 Apr 2018
1/* When a request is done with an empty host:
2
3GET / HTTP/1.1
4Host:
5Then isset($_SERVER['HTTP_HOST']) is true!
6
7It is better to use empty like:*/
8
9$host = '';
10if (!empty($_SERVER['HTTP_HOST'])) {
11  $host = $_SERVER['HTTP_HOST'];
12}