私の配列のvar_dumpは次のように表示されます。配列内のmy_optionsの数を取得したいと思います。インデックス2にはオプションがないことに注意してください。どうやってやるの?
var_dump($myVar);
array
0 =>
object(app\models\Product)[209]
protected '_Nested' =>
array
empty
protected '_Sibling' =>
array
empty
protected '_class' => string 'app\models\Customer' (length=18)
protected '_data' =>
array
'_id' => int 345543
'customer_name' => string 'John Dee' (length=14)
'Sibling' =>
array
...
'my_options' =>
array
...
'Nesting' =>
array
...
'image' => string 'img.jpg' (length=35)
'inventory' =>
array
...
'name' => string 'papa john' (length=35)
'price' => float 26
'status' => int 1
1 =>
object(app\models\Product)[209]
protected '_Nested' =>
array
empty
protected '_Sibling' =>
array
empty
protected '_class' => string 'app\models\Customer' (length=18)
protected '_data' =>
array
'_id' => int 89237
'customer_name' => string 'Linda Arap' (length=14)
'Sibling' =>
array
...
'my_options' =>
array
...
'Nesting' =>
array
...
'image' => string 'img2.jpg' (length=35)
'inventory' =>
array
...
'name' => string 'Pizza Hut' (length=35)
'price' => float 26
'status' => int 1
2 =>
object(app\models\Product)[209]
protected '_Nested' =>
array
empty
protected '_Sibling' =>
array
empty
protected '_class' => string 'app\models\Customer' (length=18)
protected '_data' =>
array
'_id' => int 89237
'customer_name' => string 'Linda Arap' (length=14)
'Sibling' =>
array
...