<?php
$array = ['1','a','b','c'];
echo "$array[2]". "\n";
echo $array [4]= 'd'."\n";
echo $array[]='f'."\n";
//aasocoative array
$grosery=['chocolate'=>1,
'sugar'=>10,
'salt'=>3,
'apple'=>2,
'mango'=>5]; // ['1','a','b','c'], this isn't any differnt from the one on the left
echo 'Simple arrray: ' . "\n";
foreach($array as $key=>$thing) {
echo $key . ' ' . $thing. "\n";
}
echo 'Associative array: ' . "\n";
foreach($grosery as $key=>$thing) { //btw, it is spelled grocery
echo $key . ' ' . $thing. "\n";
} // now veeeeeerrrrryyy carefuly see the difference and burn it in your mindd!