Hướng dẫn array_values() trong php

  • Trang chủ
  • Phát triển web
  • PHP
  • Hàm array_values[] trong PHP

Hướng dẫn cách sử dụng hàm array_values[] về mảng trong lập trình PHP

Tác dụng của hàm array_values[]

The array_values[] function returns an array containing all the values of an array.

The returned array will be indexed numerically, starting with 0 and increase each time by 1.

The following table summarizes the technical details of this function.

Return Value:Version:
Returns an indexed array of all the values of an array.
PHP 4+

Syntax

The basic syntax of the array_values[] function is given with:

The following example shows the array_values[] function in action.

Parameters

The array_values[] function accepts the following parameters.

ParameterDescription
array Required. Specifies the array to work on.

More Examples

Here're some more examples showing how array_values[] function actually works:

This function may ignore the numeric indexes, let's try out an example and see how it works:

Bài viết này đã giúp ích cho bạn?

Bài viết mới

Chủ Đề