I'm sorry if this has been asked many times before, I have searched extensively but to no avail. Also, I admit objects are at the limits of my current understanding so I may get my terminology wrong, I hope nevertheless I can communicate the problem.
$posts[0]->post_title
has value 'my title' and prints out that value fine.
I have a string ex a POST variable
$thisstring = 'posts[0]->post_title'
I want to print out 'my title' again starting with $thisstring.
In reality the string can be anything, I do not know in advance it is an object or which value it is going to address. So this looks like variable variables to me, and for everything else, even multidimensional arrays, I am getting the right results.
With this though I either get parse errors or empty values. I have tried the basic
$thisvalue = $$thisstring
plus every combination of curly brackets, plus every combination of curly brackets plus text....that I can think of. I can't crack it.
There was an example in the notes to the php manual of
$b=${'a'.$i};
which seemed to me to indicate you could treat the contents of the curly brackets like a normal string eg
${'posts[0]'.'->'.'post_title'};
where I could replace those strings with variables, but no such luck.
Any ideas, suggestions?
Andrew