stdClass problem

Discussion in 'Programming' started by bumbar, Jun 7, 2010.

  1. #1
    Hallo!

    I do not know what is this stdClass.

    I get the following array with print_r().
    
    Array
    (
        [0] => stdClass Object
            (
                [id] => 1477
                [name_news] => bla bla
            )
    
        [1] => stdClass Object
            (
                [id] => 1719
                [name_news] => more bla
            )
    )
    
    PHP:
    But what is obtained by using foreach:
    
     foreach ($response as $new) {
        echo  $new . "<br>";
     }
    
    PHP:
    Catchable fatal error: Object of class stdClass could not be converted to string

    :confused::confused:

    What is this? Thanx!
     
    bumbar, Jun 7, 2010 IP