PHP's algorithm can be said to be very powerful, some people say that learning PHP and other programming languages, must think logic good, then the following this problem programmer the great God come to see it!
5 people stole a bunch of apples and
The function of routing is to distribute requests to different controllers, based on the principle of regular matching. Next, we implement a simple router, the ability to implement is for static routing (no placeholder), the correct call to callback.
Instance
Calculate the Metaphone key for "world":
Definition and usage
The Metaphone () function computes the Metaphone key for the string.
The Metaphone key represents the English pronunciation of the string.
The Metaphone () function is useful
Instance
Converts the first character of "Hello" to lowercase. :
Definition and usage
The Lcfirst () function converts the first character in a string to lowercase.
Related functions:
Ucfirst ()-Converts the first character in a string to uppercase.
Instance
Returns an array of flip orders:
Definition and usage
The Array_reverse () function returns an array of flip orders.
Grammar
Array_reverse (Array,preserve)
parameters
description
array
required.
In the current development of PHP, most programmers will develop a number of user registration and other functions, sometimes for the sake of beauty, the user's avatar will also have relative requirements, then we will tell you how to use PHP to
Before we introduce to you the use and implementation of PHP recursive functions, as well as the problems in PHP recursive functions, what is the invocation of PHP recursive function, the following we use an example of the specific
Instance
Combine two arrays into an array:
Definition and usage
The array_merge_recursive () function is used to combine one or more arrays into an array.
The difference between this function and the Array_merge () function is that it handles two
Instance
Returns a new array containing all the key names in the array:
Definition and usage
The Array_keys () function returns a new array that contains all the key names in the array.
Grammar
Array_keys (array,value,strict)
The function of the header () is to send an original HTTP header [HTTP header] to the client.
The header is a string sent by the server to the browser before the HTML data is transmitted to the HTTP, in the header
There is an empty line separating
1. Define constant define ("CONSTANT", "Hello World");
Constants can only contain scalar data (boolean,integer,float and string).When calling a constant, simply use the name to get the value of the constant, not the "$" symbol, such as: Echo
Instance
Compares the key names and key values of two arrays and returns the intersection:
"Green", "c" = "blue"), $result =array_intersect_assoc ($a 1, $a 2);p Rint_r ($result);? >
Definition and usage
The ARRAY_INTERSECT_ASSOC () function is used
Instance
Remove the character to the left of the string ("He" in "Hello" and "d!" in "World") ):
"; echo Trim ($str, "hed!"); >
Definition and usage
The trim () function removes white space characters or other predefined characters on either side of
In our last article, we introduced the effect of PHP to achieve paging, so what is the principle of paging implementation? Today will take you to explain the principle of PHP paging.
Pagination display is a very common way to browse and display
Paged believe that the small partners are more familiar with this, in our PHP development, whether it is the enterprise station, mall. Backstage management are inseparable from the page, can be described as an essential part of the page effect in
Instance
The function returns the length of the string "Hello":
Definition and usage
The strlen () function returns the length of the string.
Grammar
Strlen (String)
Parameters
Describe
String
Necessary. Specifies
Instance
Compare two strings (case insensitive):
Definition and usage
The strcasecmp () function compares two strings.
Tip: the strcasecmp () function is binary safe and is case-insensitive.
Tip: This function is similar to the strncasecmp ()
In our previous articles, we introduced a summary of the PHP interview questions, as well as a summary of the thinkphp and notes in the PHP interview, which are already enough for beginners and not a lot of small partners to work with. But for some
With the continuous progress of the IT industry, many PHP programmers have been fully into the development of the Master stage, with the online PHP tutorial video also less and fewer, today we PHP Chinese network to recommend 2017 the latest several
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