Home >Backend Development >PHP Tutorial >php code to get global variables_PHP tutorial

php code to get global variables_PHP tutorial

WBOY
WBOYOriginal
2016-07-21 15:30:171043browse

复制代码 代码如下:

function cleanGlobal($global_array, $arg, $specialchars = true, $default = null) {
        if(key_exists($arg, $global_array) && $global_array[$arg] != null && $global_array[$arg] != "") {
                if($specialchars) {
                        return htmlspecialchars($global_array[$arg]);
                } else {
                        return $global_array[$arg];
                }
        } else {
                return $default;
        }
}

www.bkjia.comtruehttp://www.bkjia.com/PHPjc/323298.htmlTechArticle复制代码 代码如下: function cleanGlobal($global_array, $arg, $specialchars = true, $default = null) { if(key_exists($arg, $global_array) $global_array[$arg] != null $global...
Statement:
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