Hi,
Lets say I have the following data :-
index status Date
0 FF 1/12/2000 1 DD 2/12/2000 2 AA 3/12/2000
How to assign them into a single array[] (Not Multi-Dim) with 2 items ?
How to access the Date of index 2 ?
Thks & Happy Holidays
You can't. However, you can place either an associative array into the item or object to make it easier to work with. i.e.:
class YourItem { var $Index; var $Status; var $ItemDate; } // Populate an item $items[0] = new YourItem; $items[0]->Index = 1; $items[0]->Status= 'FF'; $items[0]->ItemDate = Date();
//Access an item
echo $items[0]->Status;
Hope this helps,
Jack
I see. Since i only have 2 items, assign them into 2 seperate arrays shld not affect much on efficiency, right ?
Thanks 🙂