I want to assign a value to my class variable please see the code below. I want to assign an array to $items? can i do this? If i can do please help me out. thanks class myClass { var $items; } $obj = new myClass; PHP:
I wouldn't do that, you are removing an important aspect of OOP (using control coupling). I would assign a function to handle the values and not allow externals to manipulate it except through the functions. Peace,