Indexed arrays can be created in PHP using two primary methods: Using the array() constructor.
$fruits = array("apple", "banana", "orange");
- Using the short array syntax (square brackets
[]
$colors = ["Red", "Green", "Blue"];
Indexed arrays can be created in PHP using two primary methods: Using the array() constructor.
$fruits = array("apple", "banana", "orange");
[]
$colors = ["Red", "Green", "Blue"];
Add New Comment