Tuesday, July 3, 2012

arrays in php

An array can be simply defined as a collection of data stored within one variable. To do this in php initialize the variable using the dollar sign, and then in the right hand side add the values within rounded brakets each data entry separated with a inverted comma. Bear in mind that the types of the data should not be different for each value within that array.

An example of an array :-
$food = ('apple', 'chicken' ,' sandwich');

No comments:

Post a Comment