Tools, FAQ, Tutorials:
Retrieving All Keys from an Array in PHP
How To Get All the Keys Out of an Array in PHP?
✍: FYIcenter.com
Function array_keys() returns a new array that contains all the keys of a given array. Here is a PHP script on how to use array_keys():
<?php $mixed = array(); $mixed["Zero"] = "PHP"; $mixed[1] = "Perl"; $mixed["Two"] = "Java"; $mixed["3"] = "C+"; $mixed[""] = "Basic"; $mixed[] = "Pascal"; $mixed[] = "FORTRAN"; $keys = array_keys($mixed); print("Keys of the input array:\n"); print_r($keys); ?>
This script will print:
Keys of the input array: Array ( [0] => Zero [1] => 1 [2] => Two [3] => 3 [4] => [5] => 4 [6] => 5 )
⇒ Retrieving All Values from an Array in PHP
⇐ Finding a Given Value in an Array in PHP
2017-01-21, 1930🔥, 0💬
Popular Posts:
How to read Atom validation errors at w3.org? If your Atom feed has errors, the Atom validator at w3...
How To Create an Array with a Sequence of Integers or Characters in PHP? The quickest way to create ...
How to use the Atom Online Validator at w3.org? w3.org feed validation service is provided at http:/...
What Is HTML? HTML (HyperText Markup Language) is the standard markup language for creating Web page...
How to register and get an application ID from Azure AD? The first step to use Azure AD is to regist...