• Dec
    24

    Get Key value in Array with PHP

    Filed under: PHP;

    hi 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”;
    }

    No Comments

Leave a Reply