これが私の取得したオブジェクトだったとしましょう$myObj
Array
(
[0] => xl_oio_0_1_Mytitle Object
(
[_unknown:protected] =>
[header_:protected] => Header Object
(
[_unknown:protected] =>
[myId_:protected] => my_title
[userId_:protected] =>
[createTime_:protected] =>
)
[id_:protected] => ID Object
(
[_unknown:protected] =>
[id_:protected] => ingy3spdzE1uiMtCYRSlmwtX
)
[dataType_:protected] => 2
[picSize_:protected] => 8669
[userId_:protected] => ID Object
(
[_unknown:protected] =>
[id_:protected] => ingy3spdzE1uiMtCYRSlmwtX
)
[fName_:protected] => Joe
[lName_:protected] => Smith
[cDate_:protected] => RxyascTe89Xe4
)
[1] => etc...
そして、私は名前と日付を解析しようとしています、iveは運が悪かったので次のことを試みました。
$i=0;
while( $i < 20 ){
// Notice: Trying to get property of non-object
//$firstName = $myObj->xl_oio_0_1_Mytitle->fName_;
// Fatal error: Cannot use object of type
//$firstName = $myObj[$i]['fName_'];
// Parse error: syntax error, unexpected T_OBJECT_OPERATOR
$firstName = $myObj->xl_oio_0_1_Mytitle(object->fName_);
echo $firstName . '<br />';
$i++;
}