PHP paging code in a variety of program development are required to use, in the development of the Web site is required to select one.
To write the paging code, you first need to understand the SQL query statement: SELECT * from goods limit 2, 7.
Count ()
The PHP count () function calculates the number of cells in an array or the number of attributes in an object, returns the number of cells in an array, or the number of properties in an object.
Grammar:
int count (mixed var [, int mode])
This page class does not handle SQL;
Dramatically speeds up paging functionality
Http://blog.csdn.net/fkedwgwy
Xiaoxiang Blog--Xiaoxiang
/**
Demonstrate
Require_once ('.. /libs/classes/page.class.php ');
$page =new page (' Total ' =>1000, '
Here the implementation of the PHP Import export Excel function is to use open source Phpexcel, do the following operation please download the class library file, the official website: http://www.codeplex.com/PHPExcel, website case code a lot,
PHP's own mail function compares the egg pain, the SendMail is configured under win or the message cannot be sent. Pear/mail with a third party can connect to the mail server directly via SMTP. such as (smtp.163.com). Therefore, it is not necessary
This article describes the php file upload class. Share to everyone for your reference, specific as follows:
This shows the FileUpload.class.php file upload class, which uses two constants that can be defined in the Web site configuration file:
emailclass.php
Copy Code code as follows:
?
Class Cmailfile {
var $subject;
var $addr _to;
var $text _body;
var $text _encoded;
var $mime _headers;
var $mime _boundary = "--==================_846811060==_";
var $smtp _headers;
First of all, this article is based on the WAMP environment, so, if you see here has not built a good wamp environment, mind you first set up the environment, because here are some practical content.
1. Prepare
In the WAMP environment, I use the
This article introduces some tips and techniques for improving and optimizing PHP code, for your reference, the details are as follows
1. Do not use a relative path, to define a root path
Such lines of code are common:
Require_once ('.. /..
Mind Mapping
Click on the picture below, you can see the specific content!
Introduced
Regular expression, we should be often used in the development, now many development languages have regular expression of the application, such as
This example describes the DES encryption and decryption instance implemented by PHP. Share to everyone for your reference, specific as follows:
'; echo ' str: '. $str.
' ';
$jiami = Jiami ($key, $STR); Echo ' Encrypt: '. $jiami.
'
The usually submits a form for no refreshes, and we do it using AJAX. Some time ago, I followed the boss. Another way of not refreshing a submit form is to use the IFRAME framework. Now put it out and share it with everyone. First: HTML page
Example 1
Copy Code code as follows:
The php function specifies the default value-www.jb51.net
function Printme ($param = NULL)
{
Print $param;
}
Printme ("This is Test");
Printme ();
?>
The example in this article describes the way in which PHP uses Curl to spoof landing crawl data by adding cookies. Share to everyone for your reference, specific as follows:
Some Web pages must be logged to see, this time want to crawl information
This article illustrates the method of shuffle () of PHP function to take several random elements of an array. Share to everyone for your reference, specific as follows:
Sometimes we need to take a few random elements of the array (like doing
Duplicate entries for one-dimensional arrays:
Use the Array_unique function to use the following example:
Copy Code code as follows:
$aa =array ("Apple", "banana", "pear", "apple", "wail", "Watermalon");
$BB =array_unique ($AA);
1, APC Cache introduction
APC, the full name is alternative PHP cache, official translation is called "Optional PHP Caching." It provides us with a framework for caching and optimizing PHP's intermediate code. The APC cache is divided into two
Checkdate ($month, $date, $year)If the value that is applied constitutes a valid date, the function returns True. For example, for an error date of February 31, 2005, this function returns to False.
You can use this function to check the date and
This article gives an example of how to record the time of a page in PHP. Share to everyone for your reference, specific as follows:
First in the page to be monitored add JS as follows
The log.php code is as follows
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