php 获取全局变量的代码

yipeiwu_com6年前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;
        }
}

相关文章

PHP添加Xdebug扩展的方法

xdegug是一个很好的php调试扩展,安装方法也很简单,基本和其他的扩展安装方式差不多. 一、下载对应的DLL 下载地址:https://xdebug.org/download.php...

php pki加密技术(openssl)详解

复制代码 代码如下:<?php//pki加密//使用pki加密需要开启 openssl扩展//php.ini extension = php_openssl.dll扩展/*pki模...

php动态函数调用方法

php中可以把函数名通过字符串的方式传递给一个变量,然后通过此变量动态调用函数 下面是一个简单的动态函数调用范例 <html> <head> <titl...

php批量删除数据

批量删除文章这个技术没什么高深莫测的,只是想写下来与大家分享。(适合初学者:) 1、首先在文章列表页面(list.php),将多选筐命名为:“$del_id[]”,值为文章ID号。 &n...

php生成gif动画的方法

首先需要确认GD库是否正常,如果是合成图片,请确保把分解的图片放在frames的文件夹里面。 GIFEncoder.class.php 类 <? Class GI...