0
$result = Array
(
[0] => Array
(
[Product] => Array
(
[id] => 3
)
)
)
我上面的數組,我怎麼崩潰這麼$result = 3
PHP - 關閉多維數組
$result = Array
(
[0] => Array
(
[Product] => Array
(
[id] => 3
)
)
)
我上面的數組,我怎麼崩潰這麼$result = 3
PHP - 關閉多維數組
$result = $result[0]['Product']['id']; // TA DA
只是做
$result = $result[0]['Product']['id']; // gives 3
笑,我會+1這個 –
笑!我也會+1。但我想這不是他正在尋找的答案。 –
@Neal我想知道的是爲什麼我不能得到8 + upvotes這樣的問題/答案......這是一個陰謀!在真實情況下,雖然它覺得像代表更高的代表獲得更多的選票/支持,然後那些誰不;哪種方式很糟糕,因爲我通常會在我的答案中付出很多努力,並且相當徹底(不是說你或其他人不會),甚至解決別人不會的問題。我得到的最多的是+1或者+2 upvote。猜猜這很像真正的世界,富人變得更富有,窮人變得更窮。在任何情況下, –