Home > Backend Development > PHP Tutorial > 循环出$_SERVER,出现一大堆变量未定义。解决办法

循环出$_SERVER,出现一大堆变量未定义。解决办法

WBOY
Release: 2016-06-13 13:22:32
Original
918 people have browsed it

循环出$_SERVER,出现一大堆变量未定义。

foreach($_SERVER as $i){
echo $_SERVER[$i] . '
';
}

在页面上面加上了error_reporting(E_ALL & ~E_NOTICE);
它就什么都不显示了。

------解决方案--------------------

PHP code


foreach($_SERVER as $i){
    echo $i . '<br>';
}
<br><font color="#e78608">------解决方案--------------------</font><br>
或者  <br>
Copy after login
PHP code

foreach($_SERVER as $k => $i){
    echo $_SERVER[$k] . '<br>';
} <div class="clear">
                 
              
              
        
            </div>
Copy after login
Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template