php (array and related operations)

Insert picture description here
Insert picture description here

Arrays in php can be indexed, similar to dictionaries in other languages, you can press the index to get the value. When a digital index is specified, the keys of the subsequent unspecified index will be sequentially incremented on this basis

Insert picture description here

PHP supports nested lists

Insert picture description here
Insert picture description here

You can add, update, and delete the array. Multi-dimensional array values ​​are consistent with python

Insert picture description here

Insert picture description here

The count function can calculate the length of the array and is used with a for loop.

Insert picture description here

You can also use iterators to get values ​​on an array. The list function can unpack the array, each function is equivalent to the next function in python ()

Insert picture description here
Insert picture description here

Guess you like

Origin blog.csdn.net/qq_46456049/article/details/108588779
Recommended