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
Post a Comment