Arrays in PHP
Arrays are used to store multiple values in a single variable. PHP supports different types of arrays such as indexed arrays, associative arrays, and multidimensional arrays.
Example:
php
$fruits = array("apple", "banana", "orange");
echo $fruits[0]; // apple
$marks = array("John"=>80, "Mary"=>75, "Peter"=>85);
echo $marks["John"]; // 80
No comments:
Post a Comment