PHP Accessing Indexed Arrays
Syntax
Elements in an indexed array in PHP can be accessed using their numeric indices, starting from 0.
$element = $arrayName[index];Example
// Declaring an indexed array$fruits = ["Apple", "Banana", "Cherry"];
// Accessing elementsecho $fruits[0]; // Outputs: Appleecho $fruits[1]; // Outputs: Banana
// Modifying an element$fruits[2] = "Blueberry";echo $fruits[2]; // Outputs: Blueberry