How do i initialize a 2d array in php,
if i use the 2d array in a class declaration.
since I don't know how big size is going to be, ie...how many rows...
How do I initialize it? say array was rows x 5 (columns)... rows is supposed to be determined on the fly...depending on how many records get fetched from the database. How do I initialize this array?
Thanks.
if i use the 2d array in a class declaration.
Code:
class ANIMALS {
var $array[ ] [ ] = 0; //?? how do I initialize the array if I don't know what the size is going to be...
.....
}
How do I initialize it? say array was rows x 5 (columns)... rows is supposed to be determined on the fly...depending on how many records get fetched from the database. How do I initialize this array?
Thanks.
Comment