-1
<?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.

Jon Cairns
  • 11,783
  • 4
  • 39
  • 66

0 Answers0