I would like to do something like this: echo $myObject->value_$id but I don\'t know proper syntax and I\'m not sure if it is possible.
echo $myObject->value_$id
$id
The feature is called variable properties:
value_1 = 'I am value nr 1'; $id = 1; echo $myObject->{"value_$id"};