Tools, FAQ, Tutorials:
Retrieving All Values from an Array in PHP
How To Get All the Values Out of an Array in PHP?
✍: FYIcenter.com
Function array_values() returns a new array that contains all the values of a given array. Here is a PHP script on how to use array_values():
<?php
$mixed = array();
$mixed["Zero"] = "PHP";
$mixed[1] = "Perl";
$mixed["Two"] = "Java";
$mixed["3"] = "C+";
$mixed[""] = "Basic";
$mixed[] = "Pascal";
$mixed[] = "FORTRAN";
$values = array_values($mixed);
print("Values of the input array:\n");
print_r($values);
?>
This script will print:
Values of the input array:
Array
(
[0] => PHP
[1] => Perl
[2] => Java
[3] => C+
[4] => Basic
[5] => Pascal
[6] => FORTRAN
)
⇒ Sorting an Array by Keys in PHP
⇐ Retrieving All Keys from an Array in PHP
2017-01-21, ∼3602🔥, 0💬
Popular Posts:
How to install "The Windows SDK version 8.1"? I need to build my Visual Studio C++ applications. If ...
How to access Query String parameters from "context.Request.Url.Que ry"object in Azure API Policy? Q...
How to use the Atom Online Validator at w3.org? w3.org feed validation service is provided at http:/...
How to validate the id_token signature received from Azure AD v2.0 authentication response? You can ...
How to Install Docker Desktop 2.5.0 on Windows 10? You can follow this tutorial to Install Docker De...