Hướng dẫn dùng arrays examples trong PHP
Hướng dẫn cách sử dụng hàm array() về mảng trong lập trình PHP Tác dụng của hàm array()The It is a language construct used to represent literal arrays, it is not a regular function. The following table summarizes the technical details of this function.
SyntaxThe basic syntax of the array(index=>value, index=>value, ...); The index may be of type string or integer. When indices are integers array is called indexed array, and when indices are strings array is typically called associative array. When index is omitted or not specified, an integer index is automatically generated, starting from 0. If index is an integer, next generated index will be the bigger integer (previous index + 1). Also, if two identical index are defined, the last one overwrites the previous one. The following example shows the
ParametersThe
More ExamplesHere're some more examples showing how The following example shows how to create an indexed array (i.e. array with integer indices).
The following example shows how to create an associative array (i.e. array with string indices).
The following example shows how to create a multidimensional array (an array of arrays).
Bài viết này đã giúp ích cho bạn?Bài viết mới |