PHP built-in variables and constants

Source: Internet
Author: User
$GLOBALS

var_dump($GLOBALS);//一个封装了所有在脚本中的全局变量的数组,包括php内置的和我们自己声明的

$_get

http://www.dadishe.com/test/checkbox.php?a[]=b&a[]=carray  'a' =>     array      0string'b' (length=1)      1string'c' (length=1)

Extensions

$a = get_loaded_extensions();var_dump($a);

Ini_get to get configuration information

ini_get("allow_url_fopen")?"支持":"不支持";ini_get("file_uploads")?ini_get("upload_max_filesize"):"Disabled";ini_get("max_execution_time");

Configure the time zone

date("Y-m-d H:i:s",time())date_default_timezone_get();date_default_timezone_set("ETC/GMT-8")date("Y-m-d H:i:s",time());

How to determine if a constant is defined

bool defined(string constants_name);

Line

文件中的当前行号。

FILE

__FILE__ 总是包含一个绝对路径(如果是符号连接,则是解析后的绝对路径),而在此之前的版本有时会包含一个相对路径。

DIR

文件所在的目录。如果用在被包括文件中,则返回被包括的文件所在的目录。它等价于 dirname(__FILE__)。除非是根目录,否则目录中名不包括末尾的斜杠。(PHP 5.3.0中新增) =

FUNCTION

函数名称(PHP 4.3.0 新加)。自 PHP 5 起本常量返回该函数被定义时的名字(区分大小写)。在 PHP 4 中该值总是小写字母的。

CLASS

4.3.0545.4__CLASS__traittrait 方法中时,__CLASS__trait 方法的类的名字。

TRAIT

Trait5.4.05.4trait 被定义时的名字(区分大小写)。Trait 名包括其被声明的作用区域(例如 Foo\Bar)。

METHOD

类的方法名(PHP 5.0.0 新加)。返回该方法被定义时的名字(区分大小写)。

NAMESPACE

当前命名空间的名称(区分大小写)。此常量是在编译时定义的(PHP 5.3.0 新增)。

Copyright Notice: Knowledge is taken to the people, to the people! Welcome reprint, Reprint please attach this article link, not regularly updated articles!

The above describes the PHP built-in variables and constants, including aspects of the content, I hope that the PHP tutorial interested in a friend helpful.

  • Contact Us

    The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

    If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

    A Free Trial That Lets You Build Big!

    Start building with 50+ products and up to 12 months usage for Elastic Compute Service

    • Sales Support

      1 on 1 presale consultation

    • After-Sales Support

      24/7 Technical Support 6 Free Tickets per Quarter Faster Response

    • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.