有兩個數組,它們是從foreach
給出的$link
。有一次$link
必須是第一個箭頭,第三個箭頭 - 第二個箭頭。所以:如果存在於數組(php)中
1數組:
Array (
[width] => 800
[height] => 1142
[hwstring_small] => height='96' width='67' [file] => 2010/04/white-1051279.jpg
[sizes] => Array (
[thumbnail] => Array ([file] => white-1051279-100x150.jpg [width] => 100 [height] => 150)
[medium] => Array ([file] => white-1051279-200x285.jpg [width] => 200 [height] => 285)
)
[image_meta] => Array ([aperture] => 0 [credit] => [camera] => [caption] => [created_timestamp] => 0
[copyright] => [focal_length] => 0 [iso] => 0 [shutter_speed] => 0 [title] =>))
2陣列:
Array (
[width] => 50 [height] => 50 [hwstring_small] => height='50' width='50' [file] => 2010/04/images1.jpeg
[image_meta] => Array ([aperture] => 0 [credit] => [camera] => [caption] => [created_timestamp] => 0
[copyright] => [focal_length] => 0 [iso] => 0 [shutter_speed] => 0 [title] =>)
)
的差 - 第一個具有[sizes]
。
正在尋找一種方法來檢測,是否存在[sizes]
在給定的陣列。
Tryed if (in_array("[sizes]", $link)) { } else { }
,但它不起作用。
謝謝。
是的。這很好,謝謝。 – Happy 2010-04-28 17:19:07