Function:
1, gets the current IP address,
2, call Sina API, get to the current city.
3, convert Chinese to pinyin after jump.
Copy the Code code as follows:
Include './pinyin.php ';
Get current IPfunction GetIP () {$onlineip = ";if (getenv ('
This article is the 1th in the "Becoming a PHP Professional" series of 4 blog posts.
When browsing a variety of PHP-related blogs, such as questions on Quora, Google Groups, newsletters and magazines, I often notice the level of skill
Patterns are very important for object-oriented development. A pattern can help us create objects that are capable of fulfilling a particular task and become the responsibility of the class. The pattern also allows us to modify a class, but does not
First, write a good interface program
Upload the good one interface program files on your server, such as the http://www.yourdomain.com/weixin.php content as follows:
Copy CodeThe code is as follows:
Define ("token", "Weixin");//The token that you
Command class:
1. Command role: declares an abstract interface to all specific command classes. This is an abstract role.
2. Specific command role: Define a weak coupling between the recipient and the behavior, and implement the Execute method,
1. Call_user_func
Copy the Code code as follows:function A ($b, $c) {Echo $b;Echo $c;}Call_user_func (' A ', "111", "222");Call_user_func (' A ', "333", "444");Display 111 222 333 444?>
Call the method inside the class is rather strange, incredibly
A reference to PHP is to precede variables or functions, objects, etc. with & symbols. The reference in PHP means: Different names access the same variable content. There is a difference between pointers in C and C, where the contents of a variable
The basic principle of OB: If the OB cache is open, then Echo's data is first placed in the OB cache. If it is header information, put it directly in the program cache. When the page executes to the end, the data of the OB cache is placed in the
What is a session?
The Chinese translation of the session is called "conversation", its original meaning refers to the beginning and end of a series of actions/messages, such as phone calls from the pick up the telephone to hang up the phone in the
The problem of Chinese coding in PHP programming has plagued a lot of people, the cause of this problem is actually very simple, each country (or region) has stipulated the computer information exchange with the character encoding set, such as the
In a recent Drupal project, we encountered a very strange problem: the total number of records and total pages of the search results page is always a fixed number of errors. This deceptive illusion allows us to look for the answers to the wrong
Use of Session:
Session_Start (); Defines the $_session array variable.
Session_Start () cannot have any form of output before use, including output in PHP and HTML code.
$_session arrays cannot use numeric subscripts, only string subscripts can be
A PHP script that exports data from one Redis db to another Redis db:
Copy CodeThe code is as follows: $from = ' 127.0.0.1:6200/6 ';
$to = ' 127.0.0.1:6200/8 ';
$from _redis = Redis_init ($from);$to _redis = Redis_init ($to);
$keys = $from _redis-
Object Relational Mapping (relational Mapping, or ORM) is a technique to solve the mismatch between object-oriented and relational databases. In a nutshell, ORM automatically persists objects in a program to a relational database by using metadata
Sometimes using the file_get_contents () function to crawl the Web page will be garbled phenomenon. There are two reasons to cause garbled, one is the encoding problem, one is the target page opened gzip.
Coding problem is good to do, the content
The principle is very simple, write a function first, generate 0-z one of the 36 characters. Each call to the GetOptions () method generates a character that is stored as follows: array[0] = 0, array[1] = 1, ..., array[35] = Z.
Array ([0] = 0 [1] =
Many polls have a URL and IP authentication, but using curl can be forged into arbitrary URLs and IPs to bypass some simple validations, here's a simple example.
Before the program runs, make sure that Extension=php_curl.dll is not commented out in
Thinkphp built-in a template engine comparable to smarty, which brought us a lot of convenience. The calling function, like smarty, can invoke the functions it needs, and the official has built in some common functions for everyone to call.
Like
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