-
Dec24
Get Key value in Array with PHP
Filed under: PHP;No Commentshi if u need key value of an array. try this example.
$fruits = array(“d” => “lemon”, “a” => “orange”, “b” => “banana”, “c” => “apple”);
asort($fruits);
foreach ($fruits as $key => $val) {
echo “$key = $val\n”;
}
