2012-04-05 121 views
2

我有以下對象作爲數據庫查詢的結果,對象$result->meta_value的最後一部分是我很感興趣的從對象中有一個字符串

我需要從這個值字符串:

file";s:24:"2012/04/twitter.jpg"; 

任何人都可以建議我怎麼能把這個字符串分解成有用的東西?

object(stdClass)#72 (4) { 
    ["meta_id"]=> 
    string(4) "2367" 
    ["post_id"]=> 
    string(3) "540" 
    ["meta_key"]=> 
    string(23) "_wp_attachment_metadata" 
    ["meta_value"]=> 
    string(646) "a:6:{s:5:"width";s:3:"300";s:6:"height";s:3:"180";s:14:"hwstring_small";s:23:"height='76' width='128'";s:4:"file";s:24:"2012/04/twitter.jpg";s:5:"sizes";a:2:{s:9:"thumbnail";a:3:{s:4:"file";s:24:"twitterwinjs-150x150.jpg";s:5:"width";s:3:"150";s:6:"height";s:3:"150";}s:14:"post-thumbnail";a:3:{s:4:"file";s:22:"twitter60x60.jpg";s:5:"width";s:2:"60";s:6:"height";s:2:"60";}}s:10:"image_meta";a:10:{s:8:"aperture";s:1:"0";s:6:"credit";s:0:"";s:6:"camera";s:0:"";s:7:"caption";s:0:"";s:17:"created_timestamp";s:1:"0";s:9:"copyright";s:0:"";s:12:"focal_length";s:1:"0";s:3:"iso";s:1:"0";s:13:"shutter_speed";s:1:"0";s:5:"title";s:0:"";}}" 
} 

回答

相關問題