2017-02-26 122 views
0

我想使用NodeJ從數據對象中提取數據。這些數據是由一些Wordpress插件生成的。以下是數據:從數據對象中提取數據

a:1:{s:5:"books";a:7:{i:6;a:136:{s:13:"rfbwp_fb_name";s:14:"JustAName";s:14:"rfbwp_fb_width";s:3:"700";s:15:"rfbwp_fb_height";s:3:"800";s:19:"rfbwp_fb_force_open";s:1:"0";s:21:"rfbwp_fb_enable_sound";s:1:"0";s:15:"rfbwp_fb_is_rtl";s:1:"0";s:18:"rfbwp_fb_pre_style";s:0:"";s:20:"rfbwp_fb_border_size";s:1:"0";s:21:"rfbwp_fb_border_color";s:7:"#F5F5F5";s:22:"rfbwp_fb_border_radius";s:1:"1";s:16:"rfbwp_fb_outline";s:1:"0";s:22:"rfbwp_fb_outline_color";s:7:"#DBDBDB";s:22:"rfbwp_fb_inner_shadows";s:1:"0";s:21:"rfbwp_fb_edge_outline";s:1:"0";s:27:"rfbwp_fb_edge_outline_color";s:7:"#BFBFBF";s:17:"rfbwp_fb_fs_color";s:7:"#ffffff";s:19:"rfbwp_fb_fs_opacity";s:1:"1";s:22:"rfbwp_fb_fs_icon_color";s:1:"1";s:26:"rfbwp_fb_toc_display_style";s:1:"0";s:21:"rfbwp_fb_heading_font";s:1:"0";s:23:"rfbwp_fb_heading_family";s:1:"0";s:26:"rfbwp_fb_heading_fontstyle";s:7:"regular";s:21:"rfbwp_fb_heading_size";s:0:"";s:21:"rfbwp_fb_heading_line";s:0:"";s:22:"rfbwp_fb_heading_color";s:7:"#ECECEC";s:21:"rfbwp_fb_content_font";s:1:"0";s:23:"rfbwp_fb_content_family";s:1:"0";s:26:"rfbwp_fb_content_fontstyle";s:7:"regular";s:21:"rfbwp_fb_content_size";s:0:"";s:21:"rfbwp_fb_content_line";s:0:"";s:22:"rfbwp_fb_content_color";s:7:"#ECECEC";s:17:"rfbwp_fb_num_font";s:1:"1";s:19:"rfbwp_fb_num_family";s:9:"Open Sans";s:22:"rfbwp_fb_num_fontstyle";s:4:"bold";s:17:"rfbwp_fb_num_size";s:2:"12";s:17:"rfbwp_fb_num_line";s:0:"";s:18:"rfbwp_fb_num_color";s:7:"#2d2d2d";s:17:"rfbwp_fb_toc_font";s:1:"0";s:19:"rfbwp_fb_toc_family";s:1:"0";s:22:"rfbwp_fb_toc_fontstyle";s:7:"regular";s:17:"rfbwp_fb_toc_size";s:0:"";s:17:"rfbwp_fb_toc_line";s:0:"";s:18:"rfbwp_fb_toc_color";s:7:"#ECECEC";s:23:"rfbwp_fb_toc_colorhover";s:7:"#ECECEC";s:25:"rfbwp_fb_zoom_border_size";s:1:"0";s:26:"rfbwp_fb_zoom_border_color";s:7:"#ECECEC";s:27:"rfbwp_fb_zoom_border_radius";s:1:"0";s:21:"rfbwp_fb_zoom_outline";s:1:"0";s:27:"rfbwp_fb_zoom_outline_color";s:7:"#D0D0D0";s:19:"rfbwp_fb_zoom_force";s:1:"1";s:22:"rfbwp_fb_sa_thumb_cols";s:0:"";s:29:"rfbwp_fb_sa_thumb_border_size";s:1:"1";s:30:"rfbwp_fb_sa_thumb_border_color";s:7:"#878787";s:28:"rfbwp_fb_sa_vertical_padding";s:2:"12";s:30:"rfbwp_fb_sa_horizontal_padding";s:2:"10";s:23:"rfbwp_fb_sa_border_size";s:2:"10";s:24:"rfbwp_fb_sa_border_color";s:7:"#F6F6F6";s:25:"rfbwp_fb_sa_border_radius";s:2:"10";s:19:"rfbwp_fb_sa_outline";s:1:"1";s:25:"rfbwp_fb_sa_outline_color";s:7:"#D6D6D6";s:22:"rfbwp_fb_nav_menu_type";s:1:"0";s:26:"rfbwp_fb_nav_menu_position";s:6:"bottom";s:18:"rfbwp_fb_nav_stack";s:1:"0";s:17:"rfbwp_fb_nav_text";s:1:"0";s:16:"rfbwp_fb_nav_toc";s:1:"0";s:22:"rfbwp_fb_nav_toc_order";s:1:"1";s:22:"rfbwp_fb_nav_toc_index";s:1:"2";s:21:"rfbwp_fb_nav_toc_icon";s:13:"fa fa-th-list";s:17:"rfbwp_fb_nav_zoom";s:1:"1";s:23:"rfbwp_fb_nav_zoom_order";s:1:"1";s:22:"rfbwp_fb_nav_zoom_icon";s:17:"fa fa-search-plus";s:26:"rfbwp_fb_nav_zoom_out_icon";s:18:"fa fa-search-minus";s:15:"rfbwp_fb_nav_ss";s:1:"0";s:21:"rfbwp_fb_nav_ss_order";s:1:"3";s:20:"rfbwp_fb_nav_ss_icon";s:10:"fa fa-play";s:25:"rfbwp_fb_nav_ss_stop_icon";s:11:"fa fa-pause";s:21:"rfbwp_fb_nav_ss_delay";s:4:"2000";s:16:"rfbwp_fb_nav_sap";s:1:"0";s:22:"rfbwp_fb_nav_sap_order";s:1:"2";s:26:"rfbwp_fb_nav_sap_icon_prev";s:16:"fa fa-chevron-up";s:26:"rfbwp_fb_nav_sap_icon_next";s:18:"fa fa-chevron-down";s:21:"rfbwp_fb_nav_sap_icon";s:8:"fa fa-th";s:27:"rfbwp_fb_nav_sap_icon_close";s:11:"fa fa-times";s:15:"rfbwp_fb_nav_fs";s:1:"1";s:21:"rfbwp_fb_nav_fs_order";s:1:"3";s:20:"rfbwp_fb_nav_fs_icon";s:12:"fa fa-expand";s:26:"rfbwp_fb_nav_fs_close_icon";s:14:"fa fa-compress";s:15:"rfbwp_fb_nav_dl";s:1:"1";s:21:"rfbwp_fb_nav_dl_order";s:1:"6";s:20:"rfbwp_fb_nav_dl_file";s:0:"";s:20:"rfbwp_fb_nav_dl_icon";s:14:"fa fa-download";s:19:"rfbwp_fb_nav_arrows";s:1:"1";s:27:"rfbwp_fb_nav_arrows_toolbar";s:1:"0";s:22:"rfbwp_fb_nav_prev_icon";s:18:"fa fa-chevron-left";s:22:"rfbwp_fb_nav_next_icon";s:19:"fa fa-chevron-right";s:20:"rfbwp_fb_nav_general";s:1:"1";s:30:"rfbwp_fb_nav_general_v_padding";s:2:"20";s:30:"rfbwp_fb_nav_general_h_padding";s:2:"20";s:27:"rfbwp_fb_nav_general_margin";s:2:"10";s:29:"rfbwp_fb_nav_general_fontsize";s:2:"16";s:31:"rfbwp_fb_nav_general_bordersize";s:1:"0";s:27:"rfbwp_fb_nav_general_shadow";s:1:"0";s:20:"rfbwp_fb_nav_default";s:1:"1";s:26:"rfbwp_fb_nav_default_color";s:7:"#ffffff";s:31:"rfbwp_fb_nav_default_background";s:7:"#333333";s:18:"rfbwp_fb_nav_hover";s:1:"1";s:24:"rfbwp_fb_nav_hover_color";s:7:"#68c8e4";s:29:"rfbwp_fb_nav_hover_background";s:7:"#efefef";s:27:"rfbwp_fb_nav_border_default";s:1:"1";s:25:"rfbwp_fb_nav_border_color";s:0:"";s:26:"rfbwp_fb_nav_border_radius";s:2:"50";s:25:"rfbwp_fb_nav_border_hover";s:1:"0";s:31:"rfbwp_fb_nav_border_hover_color";s:0:"";s:32:"rfbwp_fb_nav_border_hover_radius";s:1:"0";s:12:"rfbwp_fb_num";s:1:"1";s:17:"rfbwp_fb_num_hide";s:1:"1";s:18:"rfbwp_fb_num_style";s:1:"1";s:23:"rfbwp_fb_num_background";s:0:"";s:19:"rfbwp_fb_num_border";s:1:"1";s:25:"rfbwp_fb_num_border_color";s:0:"";s:24:"rfbwp_fb_num_border_size";s:1:"0";s:26:"rfbwp_fb_num_border_radius";s:1:"0";s:23:"rfbwp_fb_num_v_position";s:6:"bottom";s:23:"rfbwp_fb_num_h_position";s:5:"aside";s:22:"rfbwp_fb_num_v_padding";s:1:"5";s:22:"rfbwp_fb_num_h_padding";s:1:"5";s:21:"rfbwp_fb_num_v_margin";s:1:"4";s:21:"rfbwp_fb_num_h_margin";s:1:"4";s:11:"rfbwp_fb_hc";s:1:"0";s:15:"rfbwp_fb_hc_fco";s:1:"0";s:15:"rfbwp_fb_hc_fci";s:1:"0";s:15:"rfbwp_fb_hc_fcc";s:7:"#dddddd";s:15:"rfbwp_fb_hc_bco";s:7:"#dddddd";s:15:"rfbwp_fb_hc_bci";s:7:"#dddddd";s:15:"rfbwp_fb_hc_bcc";s:7:"#dddddd";s:5:"pages";a:16:{i:0;a:7:{s:18:"rfbwp_fb_page_type";s:11:"Single Page";s:22:"rfbwp_fb_page_bg_image";s:54:"http://localhost:8080/MyWebsite/wp-content/uploads/2017/01/C-232.jpg";s:27:"rfbwp_fb_page_bg_image_zoom";s:0:"";s:19:"rfbwp_fb_page_index";s:1:"0";s:15:"rfbwp_page_html";s:0:"";s:26:"rfbwp_fb_page_custom_class";s:0:"";s:14:"rfbwp_page_css";s:0:"";}i:1;a:7:{s:18:"rfbwp_fb_page_type";s:11:"Single Page";s:22:"rfbwp_fb_page_bg_image";s:57:"http://localhost:8080/MyWebsite/wp-content/uploads/2017/01/C-377-_1.jpg";s:27:"rfbwp_fb_page_bg_image_zoom";s:0:"";s:19:"rfbwp_fb_page_index";s:1:"1";s:15:"rfbwp_page_html";s:0:"";s:26:"rfbwp_fb_page_custom_class";s:0:"";s:14:"rfbwp_page_css";s:0:"";}i:2;a:7:{s:18:"rfbwp_fb_page_type";s:11:"Single Page";s:22:"rfbwp_fb_page_bg_image";s:73:"http://localhost:8080/MyWebsite/wp-content/uploads/2017/01/C-389-PRINTED-SHALWAR-_3.jpg";s:27:"rfbwp_fb_page_bg_image_zoom";s:0:"";s:19:"rfbwp_fb_page_index";s:1:"2";s:15:"rfbwp_page_html";s:0:"";s:26:"rfbwp_fb_page_custom_class";s:0:"";s:14:"rfbwp_page_css";s:0:"";}i:3;a:7:{s:18:"rfbwp_fb_page_type";s:11:"Single Page";s:22:"rfbwp_fb_page_bg_image";s:57:"http://localhost:8080/MyWebsite/wp-content/uploads/2017/01/c-400-_3.jpg";s:27:"rfbwp_fb_page_bg_image_zoom";s:0:"";s:19:"rfbwp_fb_page_index";s:1:"3";s:15:"rfbwp_page_html";s:0:"";s:26:"rfbwp_fb_page_custom_class";s:0:"";s:14:"rfbwp_page_css";s:0:"";}i:4;a:7:{s:18:"rfbwp_fb_page_type";s:11:"Single Page";s:22:"rfbwp_fb_page_bg_image";s:57:"http://localhost:8080/MyWebsite/wp-content/uploads/2017/01/C-413-_2.jpg";s:27:"rfbwp_fb_page_bg_image_zoom";s:0:"";s:19:"rfbwp_fb_page_index";s:1:"4";s:15:"rfbwp_page_html";s:0:"";s:26:"rfbwp_fb_page_custom_class";s:0:"";s:14:"rfbwp_page_css";s:0:"";}i:5;a:7:{s:18:"rfbwp_fb_page_type";s:11:"Single Page";s:22:"rfbwp_fb_page_bg_image";s:58:"http://localhost:8080/MyWebsite/wp-content/uploads/2017/01/CT-158-_1.jpg";s:27:"rfbwp_fb_page_bg_image_zoom";s:0:"";s:19:"rfbwp_fb_page_index";s:1:"5";s:15:"rfbwp_page_html";s:0:"";s:26:"rfbwp_fb_page_custom_class";s:0:"";s:14:"rfbwp_page_css";s:0:"";}i:6;a:7:{s:18:"rfbwp_fb_page_type";s:11:"Single Page";s:22:"rfbwp_fb_page_bg_image";s:58:"http://localhost:8080/MyWebsite/wp-content/uploads/2017/01/CT-171-_3.jpg";s:27:"rfbwp_fb_page_bg_image_zoom";s:0:"";s:19:"rfbwp_fb_page_index";s:1:"6";s:15:"rfbwp_page_html";s:0:"";s:26:"rfbwp_fb_page_custom_class";s:0:"";s:14:"rfbwp_page_css";s:0:"";}i:7;a:7:{s:18:"rfbwp_fb_page_type";s:11:"Single Page";s:22:"rfbwp_fb_page_bg_image";s:57:"http://localhost:8080/MyWebsite/wp-content/uploads/2017/01/PM-80-_3.jpg";s:27:"rfbwp_fb_page_bg_image_zoom";s:0:"";s:19:"rfbwp_fb_page_index";s:1:"7";s:15:"rfbwp_page_html";s:0:"";s:26:"rfbwp_fb_page_custom_class";s:0:"";s:14:"rfbwp_page_css";s:0:"";}i:8;a:7:{s:18:"rfbwp_fb_page_type";s:11:"Single Page";s:22:"rfbwp_fb_page_bg_image";s:95:"http://localhost:8080/MyWebsite/wp-content/uploads/2017/01/PM-109-_1_b5f54e83-54ee-4396-be67-420333354fbc.jpg";s:27:"rfbwp_fb_page_bg_image_zoom";s:0:"";s:19:"rfbwp_fb_page_index";s:1:"8";s:15:"rfbwp_page_html";s:0:"";s:26:"rfbwp_fb_page_custom_class";s:0:"";s:14:"rfbwp_page_css";s:0:"";}i:9;a:7:{s:18:"rfbwp_fb_page_type";s:11:"Single Page";s:22:"rfbwp_fb_page_bg_image";s:58:"http://localhost:8080/MyWebsite/wp-content/uploads/2017/01/PM-146-_2.jpg";s:27:"rfbwp_fb_page_bg_image_zoom";s:0:"";s:19:"rfbwp_fb_page_index";s:1:"9";s:15:"rfbwp_page_html";s:0:"";s:26:"rfbwp_fb_page_custom_class";s:0:"";s:14:"rfbwp_page_css";s:0:"";}i:10;a:7:{s:18:"rfbwp_fb_page_type";s:11:"Single Page";s:22:"rfbwp_fb_page_bg_image";s:65:"http://localhost:8080/MyWebsite/wp-content/uploads/2017/01/PM-147-Normal-_1.jpg";s:27:"rfbwp_fb_page_bg_image_zoom";s:0:"";s:19:"rfbwp_fb_page_index";s:2:"10";s:15:"rfbwp_page_html";s:0:"";s:26:"rfbwp_fb_page_custom_class";s:0:"";s:14:"rfbwp_page_css";s:0:"";}i:11;a:7:{s:18:"rfbwp_fb_page_type";s:11:"Single Page";s:22:"rfbwp_fb_page_bg_image";s:58:"http://localhost:8080/MyWebsite/wp-content/uploads/2017/01/SL-86-_1.jpeg";s:27:"rfbwp_fb_page_bg_image_zoom";s:0:"";s:19:"rfbwp_fb_page_index";s:2:"11";s:15:"rfbwp_page_html";s:0:"";s:26:"rfbwp_fb_page_custom_class";s:0:"";s:14:"rfbwp_page_css";s:0:"";}i:12;a:7:{s:18:"rfbwp_fb_page_type";s:11:"Single Page";s:22:"rfbwp_fb_page_bg_image";s:57:"http://localhost:8080/MyWebsite/wp-content/uploads/2017/01/SS-78-_5.jpg";s:27:"rfbwp_fb_page_bg_image_zoom";s:0:"";s:19:"rfbwp_fb_page_index";s:2:"12";s:15:"rfbwp_page_html";s:0:"";s:26:"rfbwp_fb_page_custom_class";s:0:"";s:14:"rfbwp_page_css";s:0:"";}i:13;a:7:{s:18:"rfbwp_fb_page_type";s:11:"Single Page";s:22:"rfbwp_fb_page_bg_image";s:57:"http://localhost:8080/MyWebsite/wp-content/uploads/2017/01/SS-81-_2.jpg";s:27:"rfbwp_fb_page_bg_image_zoom";s:0:"";s:19:"rfbwp_fb_page_index";s:2:"13";s:15:"rfbwp_page_html";s:0:"";s:26:"rfbwp_fb_page_custom_class";s:0:"";s:14:"rfbwp_page_css";s:0:"";}i:14;a:7:{s:18:"rfbwp_fb_page_type";s:11:"Single Page";s:22:"rfbwp_fb_page_bg_image";s:94:"http://localhost:8080/MyWebsite/wp-content/uploads/2017/01/SS-87-_1_77c0dce1-8f81-4d97-9102-0986cee042c9.jpg";s:27:"rfbwp_fb_page_bg_image_zoom";s:0:"";s:19:"rfbwp_fb_page_index";s:2:"14";s:15:"rfbwp_page_html";s:0:"";s:26:"rfbwp_fb_page_custom_class";s:0:"";s:14:"rfbwp_page_css";s:0:"";}i:15;a:7:{s:18:"rfbwp_fb_page_type";s:11:"Single Page";s:22:"rfbwp_fb_page_bg_image";s:58:"http://localhost:8080/MyWebsite/wp-content/uploads/2017/01/SS-113-_2.jpg";s:27:"rfbwp_fb_page_bg_image_zoom";s:0:"";s:19:"rfbwp_fb_page_index";s:2:"15";s:15:"rfbwp_page_html";s:0:"";s:26:"rfbwp_fb_page_custom_class";s:0:"";s:14:"rfbwp_page_css";s:0:"";}}}}} 

我想提取標籤rfbwp_fb_page_type,rfbwp_fb_page_bg_image,rfbwp_fb_page_type。

在此先感謝。

+2

這不是有效的JSON。 – gyre

+0

嗯。有沒有其他途徑從這個數據對象中提取數據? –

+0

謝謝@gyre我修改了我的問題 –

回答

1

使用https://www.npmjs.com/package/php-unserialize其餘的應該很簡單。

+0

謝謝,該示例工作正常,但是當我從數據庫中獲取數據時,然後我得到以下錯誤: SyntaxError:未知/未處理的數據類型:1 –

+0

我認爲它是一個回答,因爲它給了我一些關於奇怪數據的想法。現在我知道我擁有的數據類型。非常感謝@ponury –