Opendir () function
The Opendir () function opens a directory handle that can be used by Closedir (), Readdir (), and Rewinddir ().
If successful, the function returns a directory stream, otherwise it returns false and an error. You can hide the
phpMyAdmin directly with MySQL, so security is very critical, some friends for the sake of convenience, there is no password for phpMyAdmin to set a login, this is very dangerous, if the address is known to others, then your MySQL is finished. So
Note the area to Transcode
Baidu AK Application Address: Http://lbsyun.baidu.com/apiconsole/key
Copy the Code code as follows:
$city = "Jiaxing";$content = file_get_contents ("http://api.map.baidu.com/telematics/v3/weather?location=%e5%98%89%e5%
Copy CodeThe code is as follows:
/**
* Guaranteed Single Process
*
* @param string $processName process name
* @param string $pidFile process file path
* @return Boolean to continue executing the current process
*/
function singleprocess
Reprint please specify from Souldak, Weibo: @evagle
Before the session and cookies are still vague, today with the YII framework encountered SESSION_REGENERATE_ID (): Session object destruction failed this error, So I looked at the working
The. htaccess file (or "Distributed profile" provides a way to change the configuration of a directory by placing a file containing one or more directives in a particular document directory to act on this directory and all its subdirectories. As a
Match Lookup
Strstr
Strpos is commonly used in forms validation, which can be used
Substr
Positive expression matches preg_mathc (), Preg) Mathc_all (), Preg_grep ()
Conversion of the encoding format Heade ("Content-type; text-html;
The Imperial CMS encapsulates a SQL, the file location is e/class/db_sql.php, the use of the program itself class library can bring our development convenience and efficiency, but also reduce the number of additional files.
First, do the
The gzip feature is a compression of the page size to speed up the opening of the Web page, the current mainstream browser almost all support this feature. This is a very useful and popular feature, but it requires server support to turn on gzip,
First, open and use the Smarty cache
To turn on the Smarty cache, simply set the caching to true in the Smarty settings parameter and specify Cache_dir. Setting the Cache_lefetime parameter at the same time specifies the cache lifetime (in seconds)
1. If a method can be static, declare it static. Speed improvement are by a factor of 4. If a method is static, it is statically declared. The rate can be increased to 4 times times.
2. Echo is faster than print. echo is faster than print.
3. Use
Two-dimensional array sorting algorithm and one-dimensional array sorting algorithm the basic theory is the same, all by comparing the small value in the left-variable array, the large value in the right array in the separate recursion.
1, '
There are two basic types of XML parsers:
Tree-based parser: This parser transforms an XML document into a tree structure. It parses the entire document and provides an API to access the elements of the tree, such as the text
Document Object Model (
Copy CodeThe code is as follows:
/**
Obtain the MAC address source of the network card; currently supports Win/linux system
Get the physical (MAC) address of the machine card
**/
Class getmacaddr{
var $return _array = Array (); Returns an array
PHP implements the maximum number of positive and negative arrays, which is required for the array, which consists of positive and negative numbers, to find out the maximum number of sub-arrays of contiguous elements in the array.
It's actually a
Copy CodeThe code is as follows:
Paging function First page: URL/1 second page: URL/2
function pages ($url, $totalnum, $page, $pagesize = 20) {
$urladd = ";
$url. = '/';
$totalpage = Ceil ($totalnum/$pagesize);
if ($totalpage $page = min
Pagination page numbering display algorithm
Copy CodeThe code is as follows:/*** Get HTML content for pagination* @param integer $page current page* Total number of pages $pages @param integer* @param string $url The last page of the URL address
This library is simple, easy to use, easy for you to modify and improve the function, can solve most of the PHP project executed SQL operations.
Preliminary work
First of all, please download this class library m.class.php and then download a
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