Learn PHP's array summary "experience", PHP array Summary
PHP has a lot of functions for arrays, which makes it easy to manipulate arrays.
Defined:
The array contains two items per entity: Key and value, which can be obtained by querying the key.
Ange ($low, $high), Range ($low, $high, $step);//Create an array of sequential values such as: Range (1,4) as (1,2,3,4) and range (' A ', ' Z ')
Each ($array) returns the current element of the array sequentially, and sets the next element to the
1. Merging Arrays
The Array_merge () function merges the arrays together to return an array of unions. The resulting array starts with the first input array parameter, forcing it sequentially in the order in which the array parameters appear later.
A What is an array
An array is a set of elements that have some common characteristics, including similarity and type.
Each element is distinguished by a special identifier, called key, and each key has a value
1. Two ways to create an array:
1.1
For Web programming, the most important thing is to access and read and write data. There may be many ways to store them, such as strings, arrays, files, and so on. arrays, which can be said to be a more important way of data application in PHP. PHP
How to define an array: There are two main ways to create an array in PHP, let's look at how to create an array
(1) Create an array of methods that assign values directly to each element.
The format is: $arrayname [Key]=value;
Where Arrayname is
Some php array learning notes. There are three types of php arrays: a numeric array with a numeric ID key, and an ID key in an array associated with a value multi-dimensional array containing one or more arrays, there are three types of php arrays:
We do not have a lot of PHP data, we do not have a copy of the Php4gb.chm. I admire the function library part of it most, the real online help. But the pace of PHP development is so fast, you sui, I recently found some extended array functions in
Common PHP array functions
I. basic functions of array operations
Key name and value of the array
Array_values ($ arr); obtain the array value array_keys ($ arr); obtain the array key name array_flip ($ arr ); values in the array are exchanged
Array: Creates a new array.Array_walk: Lets a user customize a function to handle every element in an array.Arsort: Sorts the values of an array from large to small.Asort: Sorts the values of an array from small to large.Count: Calculates the number
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.