Example of PHP Arrays | array() function creates a PHP Array
An example of a PHP Array is here
$cars1 = "Volvo";
$cars2 = "BMW";
$cars3 = "Toyota";
In PHP, create an array.
The array() function in PHP is used to build an array.
array(); There are three varieties of arrays in PHP:
Arrays with a numeric index are known as "indexed arrays."
Named-key arrays are associative arrays.
arrays with one or more arrays that are multidimensional
Get The Dimension of an Array A count() Function
The length (the number of entries) of an array is returned using the count() function:
Example: echo count($cars); php $cars = array("Volvo", "BMW", "Toyota");
PHP Arrays
An array is a particular variable, which may hold more than one value at a time. It uses Brackets and commas to store the data.
If you have a list of objects, such as a list of automobile names, you might store the cars in separate variables as follows.
An example of a PHP Array is here
$cars1 = "Volvo";
$cars2 = "BMW";
$cars3 = "Toyota";
BIO About the Author: Joseph P Fanning
Joe studied at Harvard. He owns Joepfanning.com and blogs alot about cool things and stuff. He co owns Business Process Automation
Phone - 201 334 8743
Email - Joe's App email
Suffolk County LI New York 11772 Bergen County NJ Programmer