2010-12-19 69 views
0

我在wordpress主題選項表選項字段碰到過這樣的代碼:WordPress的SQL格式在主題選項

a:34:{s:15:"generalsettings";N;s:0:"";N;s:12:"color_scheme";s:0:"";s:9:"site_name";s:0:"";s:11:"custom_logo";s:0:"";s:10:"twitter_id";s:48:"also include facebook username:this is a comment";s:13:"header_teaser";s:10:"customtext";s:12:"teaser_style";s:0:"";s:13:"teaser_custom";s:0:"";s:13:"cufon_disable";N;s:18:"breadcrumb_disable";N;s:14:"analytics_code";s:0:"";s:8:"homepage";N;s:11:"teaser_text";s:0:"";s:13:"teaser_button";s:2:"26";s:16:"mainpage_content";s:0:"";s:19:"home_teaser_disable";N;s:14:"slider_disable";s:1:"1";s:12:"slider_speed";s:0:"";s:15:"homepage_slider";s:6:"custom";s:15:"slider_showcats";s:0:"";s:12:"slider_count";s:0:"";s:4:"blog";N;s:9:"blog_page";s:0:"";s:16:"blog_excludecats";s:0:"";s:21:"related_popular_posts";N;s:16:"social_bookmarks";N;s:12:"about_author";N;s:7:"sidebar";N;s:14:"footersettings";N;s:11:"footer_text";s:0:"";s:14:"footer_include";s:0:"";s:11:"navsettings";N;s:12:"show_hide_pg";s:0:"";} 

這是什麼格式,我在哪裏可以找到更多關於它的信息?

+0

找到它,答案是數組。 [URL = HTTP://striderweb.com/nerdaphernalia/2008/07/consolidate-options-with-arrays/] http://striderweb.com/nerdaphernalia/2008/07/consolidate-options-with-arrays/ [/ URL] – Gandalf 2010-12-19 11:21:48

回答

0

不完全是數組。他們是序列化的數據。你可以使用反序列化函數來恢復它,在這個例子中,它是數組! =)

Array ([generalsettings] => [] => [color_scheme] => [site_name] => [custom_logo] => [twitter_id] => also include facebook username:this is a comment [header_teaser] => customtext [teaser_style] => [teaser_custom] => [cufon_disable] => [breadcrumb_disable] => [analytics_code] => [homepage] => [teaser_text] => [teaser_button] => 26 [mainpage_content] => [home_teaser_disable] => [slider_disable] => 1 [slider_speed] => [homepage_slider] => custom [slider_showcats] => [slider_count] => [blog] => [blog_page] => [blog_excludecats] => [related_popular_posts] => [social_bookmarks] => [about_author] => [sidebar] => [footersettings] => [footer_text] => [footer_include] => [navsettings] => [show_hide_pg] =>)