Through learning to learn from the realization of friends to organize, the implementation of the PHP version of the micro-letter public platform to push the message, to share with you for your reference, the specific content as follows This method
Copy Code code as follows:
Function Genpage (& $sql, $page _size=10)
{
Global $pages, $sums, $eachpage, $page; Total number of pages, total records, per pages, current page
$page = $_get["page"];
if ($page ==0) $page = 1;
$eachpage = $page
Copy Code code as follows:
/**
by Lenush;
*/
Class Tree
{
var $data = array ();
var $child = array ( -1=>array ());
var $layer = array ( -1=>-1);
var $parent = array ();
function tree ($value)
{
$this->setnode (0,-1, $value);
First of all, let's meet restful.
RESTful is a design style rather than a standard, such as an interface: HTTP://WWW.TEST.COM/USER/VIEW/ID/1
Represents obtaining user information with ID 1, which can be changed if the restful style is used:
Http:/
The example of this article analyzes each and list usage in PHP. Share to everyone for your reference, specific as follows:
The use of 1.each
Look at the API first
Array each (array & $array)
The API describes this: each-returns the current
This example describes the use of the list () function in PHP. Share to everyone for your reference, specific as follows:
The list () function in PHP is used to assign values to a set of variables in one operation.
Note : The array variable here
The discovery today of the need to call subclasses in the parent class has never been used before and is also possible through practice. Examples such as:
Copy Code code as follows:
/**
* Parent class calling subclass method base class
Copy Code code as follows:
Set up the files we are going to use
$srcurl = "http://localhost/index.php";
$tempfilename = "tempindex.html";
$targetfilename = "index.html";
?>
Generating
generating ...
First delete the
The difference between ordinary users and search engine spiders is that they send the user agent,
Look at the website log file can find Baidu Spider name contains Baiduspider, and Google is Googlebot, so we can judge by the user agent sent to decide
PHP has only categories (Class), methods (method), attributes, and single inheritance (extensions). For users who are not accustomed to using C + +, Java, Delphi and other object-oriented language to develop programs, it may be useful to read a book
In general, PHP is rarely used to execute Linux commands, but you might use them in special cases. I used to know that there are two functions that can execute Linux commands, one is exec, the other is shell_exec. In fact, there are many, combined
Copy Code code as follows:
/**
* Traverse the directory to find all files of a suffix name in the directory
* */
function Viewdir ($directory, $ext) {
if (Is_dir ($directory)) {
$handle = Opendir ($directory);
while ($file = Readdir
If the number of record bars on the left is less than the $space (page segment) value, the page number $start from 1 to the right. If the number of record bars on the left is more than $left (the left and right pages are displayed), $start the
This is a php example of arrays, a brief description of the basic use of the array, the example added a note
Copy Code code as follows:
Defines a string array
$fruit = Array (\ "apple\", \ "orange\");
Value of reference array
$fruit [0];/
Copy Code code as follows:
Change lines for different systems in PHP
The implementation of line wrapping between different systems is not the same
Linux and Unix use \ n
MAC with \ r
windows in order to reflect the difference with Linux is \
PHP Asynchronous Invocation method
The client and server are connected through the HTTP protocol, the client initiates the request, the server side receives the request, executes the processing, and returns the processing result.
Sometimes 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.
A Free Trial That Lets You Build Big!
Start building with 50+ products and up to 12 months usage for Elastic Compute Service