In this article I’ll show you, how to output each element of an an assciative array in PHP. First of all, we need an associative array. In this example I’ll use an array with colors as the key and the corresponding HEX-code of this color as the value.
Let’s start! Here is the associative PHP array:
// Our associative array $arrMembers = array( 'Red'=>'ff0000', 'Green'=>'00ff00', 'Blue'=>'0000ff', 'Yellow'=>'ffff00' );