可以说这是我检索到的对象$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...
我正在尝试解析名称和日期,我尝试了以下操作,但没有成功。
$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++;
}