CopyCodeThe Code is as follows:
Function relativepath ($ apath, $ bpath ){
$ Shard r = explode ('/', $ apath); // The explode function is used to split a string and return the split array. Here, the string is split '/'.
$ Barr = explode ('/', $
There are many similarities between Schema patterns, because there are several relationships in the object model structure: inheritance and implementation between classes, and object combination, which are the main purpose of the PHP design pattern.
When using the PHP oo mode to develop a system, we usually get used to storing the implementation of each class in a separate file, which makes it easy to reuse classes, at the same time, it will be very convenient for future maintenance. This is
I. first look at the simplest situation. There are two Arrays:$ Arr1 = array (1, 9, 5 );$ Arr2 = array (6, 2, 4 );Array_multisort ($ arr1, $ arr2 );Print_r ($ arr1); // The order is, 9.Print_r ($ arr2); // The Order is 6, 4, 2.I estimate that the
Copy codeThe Code is as follows: Function map ($ fun, $ list, $ params = array ()){
$ Acc = NULL;
$ Last = array_push ($ params, NULL, $ acc)-1;
Foreach ($ list as $ params [$ last-1]) {// This method is amazing for the first time.
$ Params [$
In the process of using PHP, it is found that the php Code Compiled by myself is put on the server in the source code mode, so it is easy for others to take away and modify the code (which is developed by themselves.
To save my work, I have been
The fopen () function is used to open a file in PHP.The first parameter of this function contains the name of the file to be opened, and the second parameter specifies the mode used to open the file:
Copy codeThe Code is as follows: $ File = fopen (
Die ()Stop program running and output content
ExitIs to stop the program running, no output content
ReturnYesreturn Value
DieStop only when an error occurs.
ExitIs to stop directly without running the subsequent code, exit () can display
Flush function: refreshes the output buffer.Ob_clean function: clears the output buffer.Ob_end_clean function: clears the buffer and disables the ongoing output buffer.Ob_end_flush function: sends buffer data and closes the buffer.Ob_flush function:
This article describes three methods for generating static html files in Php.
1. The following is a template method!
Copy codeThe Code is as follows: $ Fp = fopen ("templets.html", "");
If ($ fp ){
$ Fup = fread ($ fp, filesize ("templets.html "));
As follows:
Copy codeThe Code is as follows: $ T = new executeTime;
Phpinfo ();
Class executeTime {
Private $ microtime;
Public function _ construct (){
$ This-> microtime = microtime (true );
}
Public function getNow (){$ This->__
When using php to write page programs, I often use the variable processing function to determine whether the variable value of a parameter at the end of the php page is null. At the beginning, I used to use the empty () function, but some problems
The Interpreter (Interpreter) mode, which includes a syntactic representation with a composite class layered structure, the rule is mapped to the class, the expressions following the syntax can be converted into an abstract syntax tree. Except for
What is Hessian?Hessian is an open-source remote communication protocol provided by caucho.The binary RPC protocol is used for HTTP transmission. The server does not need to open any firewall port.The protocol specification is public and can be used
Whether PHP can be successfully run on the Apache server depends on how we configure the PHP running mode.
Currently, PHP is run in three ways:
A. It may be hard for beginners to understand how to load modules. In fact, it is to integrate PHP into
Copy codeThe Code is as follows: require_once "./include/zip. php ";
$ Zip = new PHPZip ();
// $ Zip-> createZip ("directory address of the folder to be compressed", "file name .zip"); // only generate files that are not automatically downloaded
$
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