PHP Indexed Array


PHP index is represented by number which starts from 0. We can store number, string and object in the PHP array. All PHP array elements are assigned to an index number by default.

There are two ways to define indexed array:
1st way:
$student=array("raj", "rajesh", "ramesh");
2nd way:
$student[0]= “raj”;
$student[1]= “rajesh”;
$student[2]= “ramesh”;
 <html>
 <body>
 <?php
 $student=array(“raj” , ”rajesh” , ”ramesh”);
 echo “student name are:- $student[0],$student[1],$student[2]”;
 ?>
 </body>
 </html>