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, ∼2672🔥, 0💬
Popular Posts:
Where to find tutorials on Microsoft Azure services? Here is a large collection of tutorials to answ...
How to add request query string Parameters to my Azure API operation 2017 version to make it more us...
How to use the JSON to XML Conversion Tool at utilities-online.info? If you want to try the JSON to ...
How to register and get an application ID from Azure AD? The first step to use Azure AD is to regist...
How To Read a File in Binary Mode in PHP? If you have a file that stores binary data, like an execut...