0 votes
in PHP by
What is the difference between indexed and associative array in PHP?

1 Answer

0 votes
by

The indexed array holds elements in an indexed form which is represented by number starting from 0 and incremented by 1. For example:

$season=array("summer","winter","spring","autumn");    

The associative array holds elements with name. For example:

$salary=array("Sonoo"=>"350000","John"=>"450000","Kartik"=>"200000");    

Related questions

0 votes
asked May 13, 2022 in PHP by john ganales
0 votes
asked Jun 5, 2020 in PHP by Robindeniel
...