Hey I have been reading some PHP class documentation and how to create classes. But I haven't seen any examples of properties inside the properties. I will give an example what I want to do:
class Properties {
public property1;
public nestedProperty1;
public nestedProperty2;
}
and I want to assign properties like this:
$Property = new Properties();
$Property->property1 = "foo";
$property1->nestedProperty1 = "bar";
So I could access data like:
$property1->nestedProperty1;
Is this possible? I need this because I'm working with a dynamic multidimentional array.
$at beginning of your variable -public $property1;Second, if you want something like$Property->property1->nestedProperty1, you can assign$Property->property1 = new Properties();