有一個數組,像這樣:獲取數組中的第n個鍵/值?
Array
(
[0] => stdClass Object
(
[url] => https://is0.Z0V.jpg
[width] => 370
[height] => 370
)
[1] => stdClass Object
(
[url] => https://is1.et/derived_pi0V_300x300.jpg
[width] => 300
[height] => 300
)
[2] => stdClass Object
(
[url] => https://is1.n100x100.jpg
[width] => 100
[height] => 100
)
[3] => stdClass Object
(
[url] => https://is1.t/dZ0V_36x36.jpg
[width] => 36
[height] => 36
)
)
如何我只得到了[2]這的foreach並將其插入這樣的:
foreach($fotoSuggSizes as $fotoSuggSize100)
{
$image_urlSugg100[] = array("urlx100"=>$fotoSuggSize100->url);
}
插入或覆蓋?什麼是http://php.net/array_splice? – hakre
ehm ...你的意思是'$ fotoSuggSizes [2] - > url' ?! – KingCrunch
對不起,只是爲了得到! – hellomello