-
With variable variables:
$myVar="variable$WithDollar"; echo $object->$myVar;
-
With curly brackets:
echo $object->{'variable$WithDollar'};
More Related Contents:
- remove duplicate key array from php [duplicate]
- Is there a use-case for singletons with database access in PHP?
- PHP method chaining or fluent interface?
- What is the best method to merge two PHP objects?
- Best practice on PHP singleton classes [duplicate]
- Why does PHP 5.2+ disallow abstract static class methods?
- PHP OOP core framework
- What is the syntax for accessing PHP object properties? [closed]
- declare property as object?
- How to use objects from other namespaces and how to import namespaces in PHP
- If Singletons are bad then why is a Service Container good?
- How do I get a PHP class constructor to call its parent’s parent’s constructor?
- When should I use stdClass and when should I use an array in php oo code?
- How to use class methods as callbacks
- Cast the current object ($this) to a descendent class
- php object attribute with dot in name
- When do I use static variables/functions in php?
- Getting static property from a class with dynamic class name in PHP
- Dynamically create PHP object based on string
- Creating anonymous objects in php
- Magic __get getter for static properties in PHP
- Nested or Inner Class in PHP
- Unresolvable dependency resolving [Parameter #0 [ $name ]]
- dynamic class names in php
- Call parent constructor before child constructor in PHP
- PHP’s function to list all objects’s properties and methods
- Passing variable from controller to view in CodeIgniter
- Is Multiple Inheritance allowed at class level in PHP?
- Method Chains PHP OOP
- PHP – Implement logging mechanism to file in several classes