Thinkphpautoload namespace custom namespace
When using thinkPHP, some custom class libraries and third-party class libraries need to be placed in a proper location. it is not good to put them in the default org folder of the system,
Code implementation of four basic sorting algorithms in PHP
Many people say that algorithms are the core of a program. the quality of algorithms determines the quality of the program. As a beginner phper, although seldom touched on
Php computing page execution time code
Class c_Timer {
Var $ t_start = 0;
Var $ t_stop = 0;
Var $ t_elapsed = 0;
Function start () {$ this-> t_start = microtime ();}
Function stop
Php obtains the user's real IP address
If a user uses a proxy server, the real ip address is not in the HTTP_CLIENT_IP header, but needs to be resolved through the http header HTTP_X_FORWARDED_FOR. The following php functions:
Php code for traversing all files and folders in a folder
Php traverses all files and folders in a folder
Function list_dir ($ dirpath ){
If ($ dirpath [strlen ($ dirpath)-1]! = "\") {$ Dirpath. = "\\";}
Static $ result_
PHP ultimate encryption function
// F (ucking) u (ncrackable) e (ncryption) function by BlackHatDBL (www.netforme.net)
Function fue ($ hash, $ times ){
// Execute the encryption (s) as frequently times as the user wants
Php converts a color to a deeper color function.
This php function can make the specified color deeper.
Function ColorDarken ($ color, $ dif = 20 ){
$ Color = str_replace ('#', '', $ color );
If (strlen ($ color )
Php code for backing up mysql data
#####################
// Deployments
#####################
// Define the name of the backup directory
Define ('backup _ dir', './mybackups ');
// Define
Php obtains and sets the variable type.
Gettype-get variable typeSyntax:String gettype (mixed $ var)The possible value of the returned string is:BooleanIntegerDoubleStringArrayObjectResourceNullUnknown typeNote:Do not use gettype () to test
Understand the scope of variables in php
Understand the scope of a variable
A scope is a range that can be used or visible to a variable in a script. PHP has six basic scope rules:
The built-in Super global variables can be used and visible
Search for PHP code of all links on the page
Function get_links ($ link ){
$ Html = file_get_contents ($ link );
$ Html = str_replace ("\ n", "", $ html );
$ Html = preg_replace ('//', "\ n", $ html );
Scheduled Tasks implemented by PHP
Sometimes the program runs automatically to regularly call the interface. There are two methods available from the Internet: 1. the ignore_user_abort () function can be used with set_time_limit (0) and
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