for the specific use of these two functions, let's take a look at it first, Array_walk, the code is as follows:
Its output reads as follows:Array (size=5) 0 + int 4 1 = int 2 = int 3 = int- 4 = int 49And for Array_map, let's take an
$arr Array (1,2,3,4,5,6, "a" =>7, "B" =>8, "C" =>9,1, "haha");Returns all the values of the array, returning the arrayVar_dump (array_values($arr));Returns all the keys of the array, returning the arrayVar_dump (array_keys($arr));Detects whether a
Array Value operations 1 value extraction PHP, use list to extract the value in the array, such as list ($ a, $ B) $ array, if the value in the list is more than the number of arrays, the redundant values in the list are set to NULL,
Array Value
This article to introduce a simple example of PHP introduction, here is mainly about the PHP array value operation and function and array traversal and array sorting examples, you can enter the reference.
Operation of Array values
1. Extraction of
This article will introduce you to a simple php entry-level instance. It mainly describes the operations and functions of php array values and the instances of array traversal and array sorting, for more information, see.
Array value operations
1.
PHP array merge, PHP array
PHP's array, and Java is a big gap, although the weak type of PHP design may be a lot of Java, C + + programmers are criticized, but I think in the array container design, PHP go far than Java and C + +.
In addition to
Array Value operations1. Value extractionIn PHP, use list to extract the values in the array, such as list ($ a, $ B) = $ array. If the number of values in the list is greater than the number of arrays, the excess values in the list are set to NULL.
PHP Arraysarray Basic writing format:1: Simple form Array ("AA", 12,true,2.2, "test", ";");2: Full form Array ("title" = "AA", "Age" =>20); This format creates a key name for an array, and if you create a key name, you cannot pass subscript 0,1,2 ...
PHP's array, and Java is a big gap, although the weak type of PHP design may be a lot of Java, C + + programmers are criticized, but I think in the array container design, PHP go far than Java and C + +.
In addition to the incomplete problem,
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.