PHP 中预定义的超级全局变量和常量, 以及魔法变量
来源:互联网 发布:黄山 知乎 编辑:程序博客网 时间:2024/05/17 22:21
PHP 中预定义的超级全局变量和常量都是在脚本内全局可见的。
超级全局变量:
$GLOBALS
$_SERVERS
$_GET
$_POST
$_COOKIE
$_FILES
$_ENV
$_REQUEST
$_SESSION
常量:
http://php.net/manual/zh/reserved.constants.php
PHP_VERSION
PHP_OS
PHP_EOL
E_ERROR
E_ALL
Magic Variable
http://php.net/manual/en/language.constants.predefined.php
__LINE__
The current line number of the file.__FILE__
The full path and filename of the file with symlinks resolved. If used inside an include, the name of the included file is returned.__DIR__
The directory of the file. If used inside an include, the directory of the included file is returned. This is equivalent to dirname(__FILE__). This directory name does not have a trailing slash unless it is the root directory.__FUNCTION__
The function name.__CLASS__
The class name. The class name includes the namespace it was declared in (e.g. Foo\Bar). Note that as of PHP 5.4 __CLASS__ works also in traits. When used in a trait method, __CLASS__ is the name of the class the trait is used in.__TRAIT__
The trait name. The trait name includes the namespace it was declared in (e.g. Foo\Bar).__METHOD__
The class method name.__NAMESPACE__
The name of the current namespace. 0 0
- PHP 中预定义的超级全局变量和常量, 以及魔法变量
- PHP中一些常用的预定义常量和变量
- PHP 预定义变量,PHP 超全局变量
- PHP中的魔术常量、预定义常量和预定义变量
- PHP中的魔术常量、预定义常量和预定义变量
- PHP中的魔术常量、预定义常量和预定义变量
- 微擎全局变量和预定义常量
- php基础知识3.常量 和预定义变量
- PHP预定义变量(超全局变量)
- php预定义变量 (超全局变量)
- PHP-常量和预定义常量
- PHP的预定义常量
- php的预定义常量
- php笔记之魔法常量和超全局变量
- php 中的静态变量和超级全局变量
- php中局部变量和全局变量 以及静态变量
- php中常用的几个魔法常量
- php预定义常量
- makefile中的自动化变量
- linux 中RPM
- js 及jq 点击别的标签触发 a 标签点击事件
- Web_PHP_DedeCMS_评论留言提交、请求、点赞闲谈;
- IOS线程数据篇11之Sqlite3的基本操作
- PHP 中预定义的超级全局变量和常量, 以及魔法变量
- 如何写出一篇专业的论文,至少从格式以及整体效果上都是professional
- solr开发案列
- JS控制浮动代码
- Go Web服务开发入门(一) -- 搭建简单web服务器
- 筛选法构造素数表
- IOS从相册上传照片
- Q1.8 Check if s2 is a rotation of s1
- 快速搭建Web环境 Angularjs + Express3 + Bootstrap3