In a web system, jumping from one Web page to another is one of the most common technologies in the project.
Page jumps may be caused by a user clicking on a link, a button, or a system is automatically generated.
Here is a common way to realize
There are a number of ways to get file suffixes, which can be summed up in 7, 8, basically the principle is divided into two kinds. The first one: Get the last "." in the filename. , and then intercept; the second: Use the explode to "." To split
PHP has written a simple user registration page. This article combines the contents of the previous article, the information submitted on the registration page post to the following page register.php, register.php will post the information submitted
Several previous design patterns have greatly improved the readability and maintainability of the PHP code. However, there are more important requirements and challenges in Web applications: Database applications. But the previous design pattern was
Today, when you write code, you find an error in your code:
$m _category->insert ($data);
I called the Insert method of the $m_category object, and strangely, the Insert method name in my own frame is lowercase, but the first letter I call here is
Profile
Create patternGuarantees that a class has only one instance and provides a global access point to access it
Characteristics
1, a class has only one instance2. It must create this instance on its own3. This example must be provided to the
The Declaration of a function1. Grammatical structure
The code is as follows
Copy Code
function functions name (argument list){function body; Optionalreturn value; Return optional}
parameter list separated by
This article is mainly summarized for beginners who don't know anything about PHP features, so the demo code takes up more space. Let's see what you need to add. Welcome to the Mail or in Phpchina's "Phper" magazine section to correct the error. A
Using a custom function method to implement the 99 multiplication table, a function is a block of code that can be executed whenever it is needed.
To create a PHP function:All functions start with the keyword "function ()".Named function – the name
Programming environment
PHP5.2.4, basically PHP4.3 the above version, this code can be used
Preparatory work
Check Upload_tmp_dir items
If the PHP development environment is built on its own, you need to edit the php.ini file before you write
Converts the first letter of each word to uppercase: Ucwords ()Capitalize the first letter of a word: Ucfirst ()First letter to lowercase: lcfirst ()Capitalize all letters: Strtoupper ()
Example
The code is as follows
Copy Code
operator symbol (action symbol)
The function of the operation symbol is divided intoOne: Arithmetic operators (+-*/% + +-)%//has two purposes: integer operation, control range operation (do not use decimal, and do not use negative numbers)Turns the
We have to use Content-type:text/json to display the JSON data properly.
The code is as follows
Copy Code
Header (' Content-type:text/json '); This is the point, it tells the object receiving the data this page output is
Similar_text-calculate the similarity between two stringsInt similar_text (string $ first, string $ second [, float & $ percent])$ First is required. Specifies the first string to be compared.$ Second is required. Specifies the second string to be
The SimpleXML function allows you to convert XML into objects.This object can be processed by using a common attribute selector or array iterator, just like any other object.Some of these functions require the latest PHP version.InstallSimpleXML
1. Obtain the unix timestamp of the specified dateStrtotime ("2009-1-22") example:1. echo strtotime ("2009-1-22 ")Result: 1232553600Returns the January 22, 2009 00:00:00 timestamp.2. Obtain the date and time of the English textExample:For ease of
Export the variables from the PHP array and register them as global variables. The key name is used as the variable name and the value is used as the variable value, as shown below: The code is as follows:Copy code $ Vars = array ('var1' => '1',
SyntaxStrtotime (time, now) parameter descriptionTime specifies the time string to be parsed.Now is used to calculate the timestamp of the returned value. If this parameter is omitted, the current time is used.Example The code is as follows:Copy
Let's not talk about the instance first.#1 array_unshift () example The code is as follows:Copy code $ Queue = array ("orange", "banana"); // defines an arrayArray_unshift ($ queue, "apple", "raspberry"); // Insert an element to the arrayPrint_r
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