What does array mean in php

(*-*)浩
Release: 2023-02-23 16:38:02
Original
6485 people have browsed it

PHP array is a function that allows operations on arrays. PHP supports single-dimensional and multi-dimensional arrays. It also provides functions for constructing arrays using database query results.

What does array mean in php

Installation

The array function is an integral part of the core of PHP. These functions can be used without installation.

In PHP, there are three types of arrays: (Recommended learning: PHP video tutorial)

Numeric array - with numeric ID key Arrays

Associative arrays - arrays with specified keys, each key associated with a value

Multidimensional arrays - Arrays containing one or more arrays

Definition and Usage

array() Creates an array, with keys and values. If the key is omitted when specifying the array, an integer key is generated that starts at 0 and increments by 1.

To create an associative array with array(), use => to separate the keys and values.

To create an empty array, do not pass parameters to array():

$new = array(); Note: array() is actually a Language construct is usually used to define an array of literals, but its usage is very similar to that of functions, so we also list it in the manual.

The above is the detailed content of What does array mean in php. For more information, please follow other related articles on the PHP Chinese website!

Related labels:
php
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template