how to create an associative array in php

46

<?php
$arr = array('fruit' => 'mango', 'vegetable' => 'tomato', 'thing' => 'bag');
echo $arr['fruit'];
/*OUTPUT
mango*/
?>
Array
(
    [Ahmed] => Rofy
    [Abdallah] => Oda
    [Michel] => Mic
    [Yahia] => ENG
)

Comments

Submit
0 Comments