This is a discussion on Question about OOP within the alt.comp.lang.php forums, part of the PHP Programming Forums category; Extended Partition wrote on Tuesday 21 October 2003 16:01: > Hello Everyone, > > I have a simple question ...
|
|||||||
| FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
|
|||
|
Extended Partition wrote on Tuesday 21 October 2003 16:01:
> Hello Everyone, > > I have a simple question and need a bit of pointing in the right direction > by someone more knowledgable than myself. Here's my problem: > > I need to setup an OOP array so I can access it like this: > > $varname[indexvalue].property1 > $varname[indexvalue].property2 > > etc... > > Can someone explain to me how to set this up? > For example, I'd like to be able to do something like > $varname[indexvalue].property1 == "Hello"; and things like that. I know I > sound like a newbie but I'd really appreciate some guidance. class SomeClassYouProbablyDontEvenNeed { var $property1; var $property2; } $varname[0] = new SomeClassYouProbablyDontEvenNeed(); $varname[0]->property1 = "Maybe you just need an array."; $varname[0]->property2 = "If so, create a multi-dimentional array then."; -- Business Web Solutions ActiveLink, LLC www.active-link.com/intranet/ |
|
|||
|
Hello Everyone,
I have a simple question and need a bit of pointing in the right direction by someone more knowledgable than myself. Here's my problem: I need to setup an OOP array so I can access it like this: $varname[indexvalue].property1 $varname[indexvalue].property2 etc... Can someone explain to me how to set this up? For example, I'd like to be able to do something like $varname[indexvalue].property1 == "Hello"; and things like that. I know I sound like a newbie but I'd really appreciate some guidance. Thanks! Anthony |
![]() |
| Thread Tools | |
| Display Modes | |
|
|