I'm quite new at object-oriented programming in PHP. Here's what I want to do.
I want to create a class of objects called "lists". The properties I want
to have for list objects include:
owner of the list
number of items in the list
the list itself
Each item in the list, of course, has several properties of their own: the
date the item was added, the name of the item, and a link to the item. I
figured that the list would be contained in an array of associative
arrays... such as,
item[0]["item"]="Palm Pilot"
item[0]["dateAdded"]="2001-03-18"
item[0]["link"]="http://www.palm.com"
The lists will be built from a database which contains information about
users and the lists that they maintain. The database part I have down pat.
Properties of the list objects can be retrieved like this, of course...
$myList=new List($userID);
$num=$myList->numItems;
$name=$myList->listOwner;
What I'm wondering is, can I do something like this:
for($i=0;$i<$num;$i++)
$itemList[$i]["item"]=$myList->item[$i]["item"];
If so, how???
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]