代码如下:
if (isset($_SERVER['HTTP_HOST']) === TRUE) {
$host = $_SERVER['HTTP_HOST'];
}
如何在 if 语句内的行中获取“ undefined index HTTP_HOST”?我的意思是,索引设置在使用前会被检查。
为什么有时不能设置 HTTP_HOST?
最佳答案
你在使用 PHP-CLI 吗?
HTTP_HOST 仅适用于浏览器。
关于php - undefined index HTTP_HOST 即使它被选中,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/12347048/