使用此行代碼時,我會得到以下輸出var_dump($ticket->find());
如何在整個ALL對象中只訪問標識符?在PHP中選擇某些數據數組
我試過var_dump($ticket->find()->identifier);
但它返回null。
array (size=2)
0 =>
object(stdClass)[9]
public 'tid' => string '1' (length=1)
public 'uid' => string '22' (length=2)
public 'subject' => string 'iPhone 8' (length=8)
public 'issue' => string 'iPhone 8 screen replacement' (length=27)
public 'device' => string 'iPhone 8' (length=8)
public 'created' => string '2017-05-25 00:01:11' (length=19)
public 'identifier' => string '29cd54bf' (length=8)
public 'status' => string 'New' (length=3)
public 'tech' => string 'None' (length=4)
1 =>
object(stdClass)[11]
public 'tid' => string '2' (length=1)
public 'uid' => string '22' (length=2)
public 'subject' => string 'iPhone 7' (length=8)
public 'issue' => string 'iPhone 7 screen replacement' (length=27)
public 'device' => string 'iPhone 7' (length=8)
public 'created' => string '2017-05-25 00:27:42' (length=19)
public 'identifier' => string 'b47f2c82' (length=8)
public 'status' => string 'New' (length=3)
public 'tech' => string 'None' (length=4)
'$ ticket-> find()[0] - > identifier'和'$ ticket-> find()[1] - > identifier'。你可以在'$ ticket-> find()[i] - > identifier'上使用循環。 –
我應該想得更難一點。謝謝。 –
'find()'方法來自哪裏?如果您使用的是框架,可能會有更直接的方法來實現您的目標。 –