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");    

...