Getting value from an object with property name as a variable
<p>Quick Question</p>

<p>Lets say I have</p>

<pre><code>$colname = 'offer_id';
</code></pre>

<p>and then I want to get a value from an object with the property name like $colname</p>

<pre><code>echo $object-&gt;$colname;
</code></pre>

<p>Usually to do a variable on the fly, I would do <strong>$object->${$colname}</strong> but its not working</p>

<p>Any one can help ?</p>
