Вопрос

I var_dumped a variable and got this, how can i show it properly?

Like,
<p> Name: <?php echo $Firstname.' '.$Lastname; ?>
Country: <?php echo $country; ?></p>

 <?php
 array(3) { 
        [0]=> object(stdClass)#19 (3) { 
                                    ["Firstname"]=> string(4) "John"
                                    ["Lastname"]=> string(4) "Lest"
                                    ["Country"]=> string(3) "USA" 
                                    }
        [1]=> object(stdClass)#20 (3) {
                                    ["Firstname"]=> string(5) "Larry" 
                                    ["Lastname"]=> string(4) "Jems" 
                                    ["Country"]=> string(6) "Canada" 
                                    } 
        [2]=> object(stdClass)#21 (3) { 
                                    ["Firstname"]=> string(3) "Jim"
                                    ["Lastname"]=> string(5) "Ricks" 
                                    ["Country"]=> string(7) "England" 
                                    }
    }
 ?>
Это было полезно?

Решение

stdClass is (kind of) an anonymous object. Firstname, Lastname and Country are properties. To access them:

echo $obj->Firstname
Лицензировано под: CC-BY-SA с атрибуция
Не связан с StackOverflow
scroll top