PHP key() Function
Complete PHP Array Reference
Definition and Usage
The key() function returns the element key from the current internal pointer
position.
This function returns FALSE
on error.
Syntax
| Parameter |
Description |
| array |
Required. Specifies the array to use |
Example
<?php
$people = array("Peter", "Joe", "Glenn", "Cleveland");
echo "The key from the current position is: " . key($people);
?>
|
The output of the code above will be:
The key from the current position is: 0
|
Complete PHP Array Reference
NEW! Altova MissionKit 2007– Save ½ off Intelligent tools for XML developers & software architects
 | |
The Altova MissionKit 2007
bundles Altova’s application development, data management and
modeling tools at 50% off their regular prices. It is available in a
variety of configurations tailored to meet the needs of software
architects and XML developers. All MissionKits include the
world’s leading XML development tools: Altova
XMLSpy,
MapForce,
and StyleVision.
Gear
up; download a FREE 30-day trial today!
|
|