Curriculum
Course: PHP Basic
Login

Curriculum

PHP Basic

PHP Install

0/1

PHP Casting

0/1

PHP Constants

0/1

PHP Magic Constants

0/1

PHP Operators

0/1

PHP Reference

0/276
Text lesson

array_values()

Example

Return all the values of an array, excluding the keys.

<?php
$a=array(“Name”=>“Peter”,“Age”=>“41”,“Country”=>“USA”);
print_r(array_values($a));
?>

Definition and Usage

The array_values() function returns an array containing all the values from the input array.

Tip: The returned array will have numeric keys, starting at 0 and incrementing by 1.

Syntax

array_values(array)

Parameter Values

Parameter

Description

array

Required. Specifying an array

Technical Details

Return Value:

Returns an array containing all the values of an array

PHP Version:

4+