During PHP compilation, php parsing support in CLI mode must not be compiled unless otherwise required. You can use-disable-cli during compilation. Once PHP in CLI mode is compiled and generated, it may be attacked.
Use this program to create a WEB
If you want to create SimpleXML objects and learn how to operate xml, see. Example. xml file:
The code is as follows:
$ Xml = simplexml_load_file ('example. XML'); // Create a SimpleXML object
Print_r ($ xml); // output XML
?>
The code is as
Replace the phpsession class with the mysql memory table. you can test the effect on your own.
The code is as follows:
/**
@ Usage: use some other storage method (mysql or memcache) instead of php sessoin
@ Author: lein
@ Version:
Use php to get the code for the date of this week, last week, this month, last month, and this quarter.
The code is as follows:
Echo date ("Ymd", strtotime ("now"), "\ n ";
Echo date ("Ymd", strtotime ("-1 week Monday"), "\ n ";
Echo date ("Ymd",
PHP's rise supports top-notch functions and shutdown. The real anonymous feature supports the following syntax:
The code is as follows:
Function getAdder ($ x)
{
Return function ($ y) use ($ x ){
Return $ x + $ y;
};
}
$ Adder = getAdder (8
PHP is a popular Web programming language. it is flexible and efficient to make it more attractive. However, its UI is not convenient, not only PHP, but any Web programming language has a similar problem in UI design. the host language and HTML are
This keyword can only be used to define classes and methods. The final keyword cannot be used to define member attributes. because final is a constant, we use define () to define constants in PHP () function, so you cannot use final to define member
For more information about how to use PHP to replace Template variables, see.
1. open a file first. here PHP-> fopen (); function is used.
Definition and usage
The fopen () function opens a file or URL.
If opening fails, this function returns FALSE.
I have to write a. XML file myself, but I have never used it. below is the content related to the XML operation class DOMDocument.
Attribute:
Attribute list of the Attributes storage node (read-only)
List of child nodes of the childNodes storage
Php paging code, relatively simple.
The code is as follows:
Function genpage (& $ SQL, $ page_size = 10)
{
Global $ pages, $ sums, $ eachpage, $ page; // total number of pages, total records, per page, current page
$ Page = $ _ GET ["page"];
If ($
Php efficiency summary helps improve the efficiency of program development and execution. 1. when passing an array in a function
Using return is more efficient than using global
For example
Function userloginfo ($ usertemp ){
$ Detail = explode ("|"
Currently, many websites are written in PHP. However, the server environment may not be FreeBSD or Linux. many PHP websites run on Windows2000, Windows2003, and WindowsServer2008 systems. In addition, according to the previous message display,
PHP Excel export Spreadsheet_Excel_Writer Excel
I have seen a lot of articles about exporting Excel from PHP, and I have done so in many ways,
For example, echo a Table and modify the header to Excel.
In fact, among the many methods, it seems that
Definition and scope of action: used to test whether a variable has a value (including 0, FALSE, or an empty string, but cannot be NULL), that is, "localhost? Fo "can also pass detection, so it is not applicable. However, if the parameter "localhost"
If the previous result is false, the operation is not executed. if the result is true, continue with the following operations. Example:
! Defined ('Magic _ QUOTES_GPC ') & define ('Magic _ QUOTES_GPC', get_magic_quotes_gpc ());
O (zookeeper) o Alas,
Compared with explode (), the strtok () function can control the pace. Cut strings as needed. Its advantages are:
1. Multiple separators can be defined at a time. When a function is executed, it is cut by a single separator rather than the entire
All printed statements, such as echo and print, must be filtered using htmlentities () before printing. This prevents Xss. Note that htmlentities mysql_real_escape_string () must be written in Chinese ()
Therefore, if an SQL statement is written
PHP to JS string with ecsape conversion added to the url, and received with PHP, and then find the unscape function to convert the internet, so the string is UTF-8, but what I need is GB2312, this is why iconv conversion is used.
$ Str = iconv ('utf-
Wei shield PHP encryption expert decryption algorithm By: Neeao, encountered using Wei shield PHP encryption expert encryption code, you can use the following code to view the source file.
The code is as follows:
/**********************************
Php function str_replace: returns a string or array. This string or array is the result after all the searches in the subject are replaced by replace.
Str_replace-Replace substring [
Str_replace]
Mixed str_replace (mixed $ search, mixed $ replace,
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