Copy the Code code as follows:
The search function, where $array is an array, $k the value to find, $low the minimum key value for the lookup range, $high the maximum key value for the lookup rangefunction Search ($array, $k, $low =0, $high =0){
PDO is more efficient than ADODB and MDB2. For now, implementing a "database Abstraction Layer" is a long way off, and using a "Database access abstraction Layer" like PDO is a good choice.
Pdo->begintransaction ()-Indicates the rollback start point
Copy CodeThe code is as follows:
Function Genpage (& $sql, $page _size=10){Global $pages, $sums, $eachpage, $page; Total pages, total records, per pages, current page$page = $_get["page"];if ($page ==0) $page = 1;$eachpage = $page _size;$pagesql =
Because PHP will search for variables in a string surrounded by double quotes, single quotes will not, note: only echo can do this, it is a string can be used as a parameter of the "function" (in the PHP manual that echo is a language structure, not
Recommended functions:
First, PHP gets the URL of the current page: Dedecms is also used for this
Copy the Code code as follows:
Get the current script URLfunction Getcururl (){if (!empty ($_server["Request_uri")){$scriptName =
Add ($key, $value, $expiry);
$key: Unique identity, used to differentiate written data
$value: Data to write
$expiry: Expiration time, default is always valid
Purpose: Writes data to Memcache
Get ($key)
$key: Get the corresponding data by $key at
Post Demo:
Number of times: 5
Address: http://localhost/Test/upload/post.php?fid=5
Completion time: 2010-02-04-05:49:27
[Click to go to the topic list after posting]
Irrigation prevention mechanism is open, can not post within 5 seconds
[Click to go
Date--Formatting a local time/date
Gmdate--Formats a GMT/UTC date/time and returns Greenwich Mean Time (GMT).
For example, we are now in the time zone is +8, then the server run the following script to return the time should be this:
The current
Iconv ("UTF-8", "Gb2312//ignore", $FormValues [' a '])
Ignore means ignoring errors at the time of conversion, and discovering that Iconv will make an error converting the character "-" to gb2312, and if there is no ignore argument, all strings
Nothing different, the following content is for a Java programmer to master the skills of comparison with PHP! Tell you, they are actually the same, but tools, no high and low points.
But you are not proficient, do not know!
1, syntax: Must be
To deal with this situation, some of the practice is to use a timestamp to rename the new file, there are a number of sequential increments, in order to solve the troublesome operation, I recently wrote a frename function, you can flexibly according
The PHP batch gets the value of the checkbox
1. Naming
2. Use
When the plan is part of a SQL instruction: if the field that participates in the control is numeric, the
if (! empty ($_post[' checkbox '))) {
$expr = Join (",", $_post[' checkbox ');
We know that there is a concept of package in Java, and in. NET there is a more convenient concept of DLL assembly references, which can be easily referenced in our own class by a collection of objects that are grouped together in a packaged form,
Make a home page call image, sometimes need to get fixed-size image, because the image position of the home page is usually specified by the designer, if it is to do the latest release image call, because do not know what proportion of images
Copy CodeThe code is as follows:
Class Page{private $pageSize;//How many rows per pageprivate $absolutePage;//Current pageprivate $pageCount;//Total page numberprivate $totalNum;//Total number of rowsprivate $prePage;//Previous PagePrivate
1. Confirm that the database service is open
2. Extended Open in PHP.ini configuration
3, check the database related version
(1) Sql2000 at this time to check the PHP directory and Apache bin directory version of the Ntwdblib.dll file is compatible,
__class__ gets the current class name, case sensitive__function__ Current function name, case-sensitive__method__ the current method name, case-sensitiveGet_class (obj);//Gets the class name of the class where the current statement is
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