Today, I am reading a demo of yaf of laruence. In the entry FILE, the author has the following definition: define (DS,); define (APP_PATH, dirname (_ FILE __). DS .... DS. application. DS); the author means that DS is defined as the path separator.
An object is called when it is instantiated. When _ construct and a function with the class name coexist, __construct will be called, and the other will not be called.
1. magic functions
(13)
1. _ construct ()
An object is called when it is
PhpHeader("Content-type:text/html;charset=utf8");Echo"Error_reporting=>".error_reporting(E_all)."";Echo"Php_self=>".$_server[' Php_self ']. "";#The file name of the currently executing script, which is related to document root. Echo"Argv=>".$_server[
Predefine variable SERVER variable: & #36; _ SERVER note: it is used in php (as the mainstream development language) 4.1.0 and later versions. In earlier versions, use & #36; HTTP_SERVER_VARS. & #36; _ SERVER is an array containing headers, paths,
: This article mainly introduces PHP pre-defined constant _ FILE __. if you are interested in the PHP Tutorial, refer to it. Directory structure:
-- F: \ website \ webgis \ index. php
Test Code: index. php
Echo"Test output _ FILE _ "; echo"".
Linuxsocket note constant & amp; pre-defined INADDR_ANY and other INADDR_ANY: all address definitions: # include & lt; netinet/in. h & gt; INADDR_ANY indicates the address 0.0.0.0. In fact, this address indicates an uncertain address, or all or any
1. Replace$s = "hello5world"; $s = preg_replace ("/\d/", "#", $s); echo $s;The output is Hello#world, and the number is replaced by #.The first number is the replaced content, and "/\d/" represents the number of the regular expression.The second
There are several ways to get URL address bar parameters:$_server["Server_port"]//get port$_server[' Http_host ']//get the domain name or host address such as www.sina.com or music.sina.com$_server[' server_name ']//get the domain name or host
Environment variablesSet environment variable: 1. Export variable name = variable Value2. Variable name = variable ValueExport variable Name(export variable name = variable Value: Declare the variable as an environment variable so that all child
C # The basic pre-defined type of recognition is not built into the language, but is built into the. NET Framework. For example, declare an int
The declared data type is actually an instance of the. NET structure system. int32.
C # divide data types
When writing code yesterday, you must obtain the current Compilation Time in the code to dynamically use the version information. Therefore, some predefined Macros in the C standard are used. Here we will summarize the following macros defined in
ArticleDirectory
_ Functionw __
A predefined macro is supported in C ++. For example:
_ File __: Indicates the currentSource codeFile Name
_ Line __:Is the current sourceCodeLine number
These macros can be directly used as
From (http://www.cnblogs.com/whiteyun/archive/2011/07/07/2099918.html)
ANSI compliant predefined macros:
_ Date __: Indicates the date when the current source file is compiled. Format: Month/day/year (MMM dd yyyy ).
_ File __: Name of the source
The built-in variables that can be used in the nginx configuration file start with the dollar sign $, or global variables. The values of some predefined variables can be changed. $ Arg_PARAMETER the variable value is the value of the variable name
These constants are defined in the PHP kernel. It includes PHP, Zend engine, and SAPI module.
PHP_VERSION (string)
PHP_ OS (string)
PHP_EOL (string)Available from PHP 4.3.10 and PHP 5.0.2
PHP_INT_MAX (integer)Available from PHP 4.4.0 and PHP
When I read a piece of code today, I found that stdclass is used in it. It can be seen from the context that this is not a custom class and should be built in PHP.
Therefore, it can be used directly:
$ OBJ = new stdclass; $ obj-> name = 'linvo ';
The example of this article summarizes the usage of several predefined variables $_server in PHP. Share to everyone for your reference. Specifically as follows:
Copy Code code as follows:
Echo ' DocumentRoot: '. $_server[' document_root '.
$_server Predefined variables
Server variables: $_server
Note: Used in PHP 4.1.0 and later versions. Previous versions, using the $HTTP _server_vars.
$_server is an array that contains such things as the head (headers), the path (paths), and the
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.