我得到這個數組,我想讀取"copy01"
(在img_4e77e508ab518_197.jpg
)的值。PHP讀取數組和對象
Array ([0] => stdClass Object ([meta_value] => O:8:"stdClass":3:{s:6:"copy01";s:25:"img_4e77e508ab518_197.jpg";s:6:"copy02";s:24:"img_4e77e508ab518_80.jpg";s:6:"copy03";s:24:"img_4e77e508ab518_36.jpg";}))
這是一個print_r($dataOne)
和$data_One
是在WP數據庫中查詢。
$dataOne = $wpdb->get_results("SELECT meta_value FROM usermeta WHERE umeta_id = '22'");
你試過'$ dataOne-> copy01'嗎? – bfavaretto