note 73438 deleted from function.array-keys by danbrown
| From: | danbrown@php.net | Date: | Wed, 25 Aug 2010 01:47:09 +0000 |
| Subject: | note 73438 deleted from function.array-keys by danbrown | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-172006@lists.php.net to get a copy of this message | ||
Note Submitter: master[at]request[dot]com
----
<?
// sample Array
$strArray=array(0=>"Apple",1=>"Chery");
foreach($strArray as $key=> $val){
echo $key ."-". $val[0];
}
?>
The output is
0 - Apple 1- Chery