从 std classin php 中获取 std class 值

get std class value from an std classin php

stdClass Object
(
    [id_pro_alert] => 155
    [User_Id] => 252
    [Pro_Id] => 329
    [alertmethod] => daily
    [Alertname] => xcxv
    [name] => cyriac
    [email] => cyriac@tewve.com
    [date] => 2016-21-10 09:20:26
    [mobile] => 
    [comments] => 
    [Alert_Id] => 329
    [Prop_Purpose] => lease
    [Min_Area] => 500
    [Max_Area] => 1000
    [Area_unit] => Sq.ft
    [Min_cost] => 1000
    [Max_cost] => 10000
    [City] => kochi
    [Create_Date] => 2016-10-17 12:59:14
    [Update_Date] => 2016-10-17 12:59:14
    [Status] => Active
    [0] => stdClass Object
        (
            [Prop_type] => Agricultural Land
        )

    [1] => stdClass Object
        (
            [Prop_type] => Office in IT park
        )

    [2] => stdClass Object
        (
            [Prop_type] => Business center
        )

)

如何从 stdclass

中获取 Prop_type
echo $array->0->Prop_type;

勾选这个,你可以访问所有Prop_type's

foreach($data as $key=>$row){
    if (is_int($key)) {
        echo $row->Prop_type;
    }
}

创建 Prop_type's

的数组
$propData =array();
foreach($data as $key=>$row){
    if (is_int($key)) {
        $propData[] = $row->Prop_type;
    }
}