Beginners to PHP, in this program we can see how to create an array value, and use the count function to get the length of the array
and how to traverse the array, what we can also see in this program is Some basic syntax in php.
$cars = array("Volvo","BMW","tOyota" );//The first step is to create an array that automatically assigns id values
echo "I like ". $cars[0].",".$cars[1].",".$cars[2].".";//Output array, this output is output to the screen
print("The length of the array is :");//Print the length of the array
echo count($cars);//Use the function to calculate the length of the array
$carss = array("Volvo","BMW","Toyota");//
$ number=count($carss);//Use the function to calculate the length of the array, return a data, and assign the data to a variable
for($x=0;$x<$number;$x++)
{
echo $cars[$x];//Output array
echo "
";
}
?>
The above introduces the creation of numerical arrays in PHP, including aspects of it. I hope it will be helpful to friends who are interested in PHP tutorials.