2011-07-25 12 views
0

나는 Images라는 이름의 배열을 가지고 있으며 거기에서 값을 얻고 싶습니다.PHP에서 배열의 값을 얻으십시오

array(1) { 
[924]=> 
object(stdClass)#4240 (24) { 
["ID"]=> 
int(924) 
["post_author"]=> 
string(1) "1" 
["post_date"]=> 
string(19) "2011-07-25 15:20:50" 
["post_date_gmt"]=> 
string(19) "2011-07-25 15:20:50" 
["post_content"]=> 
string(0) "" 
["post_title"]=> 
string(17) "Rezept zum Glück" 
["post_excerpt"]=> 
string(0) "" 
["post_status"]=> 
string(7) "inherit" 
["comment_status"]=> 
string(6) "closed" 
["ping_status"]=> 
string(4) "open" 
["post_password"]=> 
string(0) "" 
["post_name"]=> 
string(19) "rezept-zum-glueck-2" 
["to_ping"]=> 
string(0) "" 
["pinged"]=> 
string(0) "" 
["post_modified"]=> 
string(19) "2011-07-25 15:20:50" 
["post_modified_gmt"]=> 
string(19) "2011-07-25 15:20:50" 
["post_content_filtered"]=> 
string(0) "" 
["post_parent"]=> 
int(922) 
["guid"]=> 
string(60) "/wp-content/uploads/useruploads/rezept-zum-glueck-bild-1.jpg" 
["menu_order"]=> 
int(0) 
["post_type"]=> 
string(10) "attachment" 
["post_mime_type"]=> 
string(10) "image/jpeg" 
["comment_count"]=> 
string(1) "0" 
["filter"]=> 
string(3) "raw" 

} }

을 어떻게 그것에서 "GUID"값을받을 수 있나요 : 이것은 내 배열에 포함 된 데이터는 무엇입니까?

답변

0

해당 배열의 유일한 요소는 개체입니다.

미리 알고있는 경우에 따라 $images[924]->guid을하고 싶다고 생각합니다. 그렇지 않으면 foreach로 무언가를해야 할 것입니다.

0

이것은 해시입니다. 어떻게

$obj = (obj) $my_array["924"]; 
$guid = obj["guid"]; 

난 그냥 여기 추측하고 있지만, 작동 할 수 있습니다

에 대해.

관련 문제