1 | initial version |
In Laravel, you can use the array()
function to create an array with multiple dimensions. Here's an example:
$myArray = array(
array('John', 32, 'Male'),
array('Jane', 28, 'Female'),
array('Bob', 45, 'Male')
);
This creates an array with three rows and three columns. Each row represents a person, and each column represents a different piece of information about that person (name, age, gender).
You can also use the []
syntax to add elements to an existing array:
$myArray[] = array('Mary', 23, 'Female');
This adds a fourth row to the array with Mary's information.