Categories:
.NET (357)
C (330)
C++ (183)
CSS (84)
DBA (2)
General (7)
HTML (4)
Java (574)
JavaScript (106)
JSP (66)
Oracle (114)
Perl (46)
Perl (1)
PHP (1)
PL/SQL (1)
RSS (51)
Software QA (13)
SQL Server (1)
Windows (1)
XHTML (173)
Other Resources:
How To Get All the Keys Out of an Array
How To Get All the Keys Out of an Array? - PHP Script Tips - PHP Built-in Functions for Arrays
✍: 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
)
2007-04-21, 5258👍, 0💬
Popular Posts:
How To Analyze Tables with "mysqlcheck"? - MySQL FAQs - Administrator Tools for Managing MySQL Serve...
What is the difference between Class and structure’s ? Following are the key differences between the...
What Articles Have You Read about JUnit? There are a number of JUnit articles that you should read: ...
What are the two kinds of comments in JSP and what's the difference between them? <%-- JSP Co...
How To Write a Minimum Atom 1.0 Feed File? - RSS FAQs - Atom Feed Introduction and File Generation I...