Heredoc technology, in regular PHP documents and technical books are not generally described in detail, but mentioned that this is a Perl-style string output technology. But now some of the Forum program, and some of the article system, are clever
I. Using the DOM to generate and read XML files
Example one:
Copy Code code as follows:
Creates XML string and XML document using the DOM
$dom = new DOMDocument (' 1.0 ');
Add Root-
$books = $dom->appendchild
This example describes how PHP uses the date and Strtotime functions to output the specified dates. Share to everyone for your reference. The specific methods are analyzed as follows:
The date and Strtotime functions in PHP are all for dates, but
Recommend a simple and practical zoom Picture tool SimpleImage, reference http://www.white-hat-web-design.co.uk/blog/resizing-images-with-php/
How to use:
Set width and height, unequal scaling
Copy Code code as follows:
Include ('
In front of the
In the article, we mentioned that the Strtotime function is going to be a bit of a situation when you use Strtotime ("-1 month") for one months today.
So it also leads to writing this article, which includes the following:
some
When you are programming in PHP, you need to browse the files under a directory on the server, which is often a directory. The Opendir () function, the Readdir () function, the Closedir () function, and the Rewinddir () function are required to
The sort () function is used to sort the array cells from low to high.The Rsort () function is used to sort the array cells from high to low.The Asort () function is used to sort the array cells from low to high and keep the index relationship.The
PHP has many built-in functions, most of which are widely used by programmers. But there are also some functions hidden in the corner, this article will introduce you to 7 little-known, but very useful functions. A useless programmer might as well
When the server creates a session (Session_Start ()), the server creates a sessions file under the specified folder of the server with the name SessionID and sent to the browser as a value for the cookie. Every time the browser comes to the server
The PHP session of the Web server is given to memcached so that you do not have a problem with which Web server the Distributor will divide the IP connection to, and the configuration method is simple, in the PHP configuration fileAdding a statement
In the php5.2 version of the configuration, the default output_buffering is off, so running the following three lines of code will show a warning:Warning:cannot Modify header Information-headers already sent
Echo ' Hello1 ';
Header ('
The ordering of several array functions mentioned below has some commonality:The 1 array is used as the parameter of the sort function, and after sorting, the array itself is changed, and the return value of the function is bool type.
2 function
FTP upload is a common and very important implementation of PHP application techniques, today to share with you the PHP implementation of FTP upload file simple example. We hope that the study of PHP can bring some help.
The main code is as follows:
Most of the time we use the default setting for session expiration, and we can set the session expiration time for some special requirements.
For this, you can set php.ini in PHP, find session.gc_maxlifetime = 1440 # (default 24 minutes for
The loop structure in PHP has roughly a for loop, while loop, do{} while loop, and a foreach loop, in either loop,
There are roughly a few ways to jump out of a loop in PHP:Code:
Copy Code code as follows:
$i = 1;
while (true)
There are two common ways to connect a php+access database.Recommended codeYou need to be aware that the PHP fetch path is Realpath
Copy Code code as follows:
$connstr = "Driver={microsoft Access DRIVER (*.mdb)}; Dbq= ". Realpath
Yesterday to see Ecshop source code, encountered a little I did not learn just--how to use PHP implementation download xls files. According to its source code, I started to achieve a bit, successfully achieved this effect.
Source:
Copy Code
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