How to use array in PHP?
As we studied array in various languages like C++,Java similarly in PHP is used to store multiple values in single variable. It can store integer,string etc and their index will also be represented in integer value.
//To store engineering branches name in array and display them on screen
$branch = array("CSE","CIVIL","CHEMICAL","MECHANICAL");
echo "Engineering Branches : " . $branch . ", " . $branch . "," . $branch." and " . $branch . ".";
/*Output of the above program is:
Engineering Branches : CSE, CIVIL,CHEMICAL and MECHANICAL.