032 - array using index
using simple index = red
using print_r command
Array
(
    [0] => red
    [1] => 20
    [2] => blue
    [3] => green
)
<?php // 032 - array using index echo "</br><span class='myheading'> 032 - array using index</span></br>"; /* -------Array---------- */ $colors_032 = array('red', 'yellow', 'blue', 'green'); /* ----- Ist way using index*/ echo "using simple index = ". $colors_032[0]."<br>"; $colors_a_032 = ['red', 20, 'blue', 'green']; /* ----- IInd way using print_r*/ echo "using print_r command <pre>"; print_r($colors_a_032); echo "</pre>"; $colors_b_032[0] = "red"; /* --------- IIIrd way using for loops */ $colors_b_032[1] = "green"; $colors_b_032[2] = "yellow"; $colors_b_032[3] = "blue"; echo "<ul>"; for($i_032 = 0 ; $i_032 < 4 ; $i_032++){ echo "<li>$colors_b_032[$i_032]</li>"; } echo "</ul>"; ?>