Join the Stack Overflow Community
Stack Overflow is a community of 6.4 million programmers, just like you, helping each other.
Join them; it only takes a minute:
Sign up
<?php 
    foreach ($blogs as $blog) {
        $id         = $blog['id'];
        $title      = $blog['title'];
        $content    = $blog['content'];
?>
        <h1> <?php echo $title; ?></h1>
        <h1> <?php echo $content; ?> </h1>      
<?php } ?>  

This my code. everytime i run this code, this error pops up:

Fatal error: Cannot use object of type stdClass as array

Please help.

share

merged by Flexo Jun 1 '13 at 10:23

This question was merged with PHP Error: Cannot use object of type stdClass as array (array and object issues) [duplicate] because it is an exact duplicate of that question.

Browse other questions tagged or ask your own question.