Access array with variable name inside php stdClass? -


stdclass object  (    [tip1] => array     (         [text] => <p>test text</p>         [format] => 1     ) ) 

i trying loop of object of objects array

for ($i=1;$i<=10;$i++) {   echo $fromform->{'tip$i'}['text']; } 

never worked?

use double quotes,

echo $fromform->{"tip$i"}['text']; 

or wiht single quotes,

$fromform->{'tip'.$i}['text']; 

Comments

Popular posts from this blog

c# - DetailsView in ASP.Net - How to add another column on the side/add a control in each row? -

javascript - firefox memory leak -

Trying to import CSV file to a SQL Server database using asp.net and c# - can't find what I'm missing -