Home > php教程 > php手册 > body text

php 获取全局变量的代码

WBOY
Release: 2016-06-06 20:36:38
Original
1220 people have browsed it

php 获取全局变量的代码,需要的朋友可以参考下。

代码如下:
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;
}
}
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
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!