tami: Deserialisierung von Array, das ein Webservice liefert

Beitrag lesen

hi,


<?php
$test = unserialize('a:4:{s:4:"info";a:11:{s:12:"account_name";s:15:"Immoticket24.de";s:17:"ekomi_certificate";s:41:"https://www.ekomi.de/cert/6R65WJE7WW5HT3E";s:20:"ekomi_certificate_id";s:15:"6R65WJE7WW5HT3E";s:21:"ekomi_certificate_seo";s:52:"https://www.ekomi.de/bewertungen-immoticket24de.html";s:8:"fb_count";s:3:"410";s:6:"fb_avg";s:3:"4.8";s:13:"fb_avg_detail";s:6:"4.7951";s:11:"fb_avg_room";d:0;s:14:"fb_avg_service";d:0;s:15:"fb_avg_catering";d:0;s:15:"fb_avg_ambience";d:0;}s:9:"feedbacks";a:10:{i:0;a:9:{s:14:"transaction_id";s:9:"R-001.462";s:6:"rating";s:1:"5";s:11:"rating_room";N;s:14:"rating_service";N;s:15:"rating_catering";N;s:15:"rating_ambience";N;s:7:"message";s:132:"Alles bestens, einfache Anwendung, gute Info über die einzelnen Schritte. Veröffentlichungen über verschiedene Quellen sehr zeitnah.";s:7:"comment";s:0:"";s:9:"delivered";s:19:"2012-07-12 16:34:58";}i:1;a:9:{s:14:"transaction_id";s:9:"R-001.211";s:6:"rating";s:1:"5";s:11:"rating_room";N;s:14:"rating_service";N;s:15:"rating_catering";N;s:15:"rating_ambience";N;s:7:"message";s:108:"sehr gutes Preis- / Leistungsverhältnis bei einem einwandfreien persönlichen Kundenservice. Jederzeit wieder";s:7:"comment";s:0:"";s:9:"delivered";s:19:"2012-07-12 08:56:51";}i:2;a:9:{s:14:"transaction_id";s:9:"R-001.465";s:6:"rating";s:1:"5";s:11:"rating_room";N;s:14:"rating_service";N;s:15:"rating_catering";N;s:15:"rating_ambience";N;s:7:"message";s:51:"Perfekter persönlicher Service. Besser gehts nicht!";s:7:"comment";s:0:"";s:9:"delivered";s:19:"2012-07-09 18:24:41";}i:3;a:9:{s:14:"transaction_id";s:9:"R-001.466";s:6:"rating";s:1:"5";s:11:"rating_room";N;s:14:"rating_service";N;s:15:"rating_catering";N;s:15:"rating_ambience";N;s:7:"message";s:134:"Ich wurde umgehend persönlich kontaktiert und meine Buchungswünsche wurden perfekt umgesetzt. Bei dem Preis ein unschlagbares Angebot!";s:7:"comment";s:0:"";s:9:"delivered";s:19:"2012-07-09 18:23:47";}i:4;a:9:{s:14:"transaction_id";s:9:"R-001.445";s:6:"rating";s:1:"5";s:11:"rating_room";N;s:14:"rating_service";N;s:15:"rating_catering";N;s:15:"rating_ambience";N;s:7:"message";s:135:"Wirklich nicht mehr zu verbessern; weiter so. Habe die Empfehlung von meinem Schwiegervater bekommen (BJ 44). Kann es kaum glauben. ;-)";s:7:"comment";s:0:"";s:9:"delivered";s:19:"2012-07-06 08:57:33";}i:5;a:9:{s:14:"transaction_id";s:9:"R-001.442";s:6:"rating";s:1:"5";s:11:"rating_room";N;s:14:"rating_service";N;s:15:"rating_catering";N;s:15:"rating_ambience";N;s:7:"message";s:57:"Tolle Idee, toller Kundenservice, absolut empfehlenswert!";s:7:"comment";s:0:"";s:9:"delivered";s:19:"2012-07-05 09:54:21";}i:6;a:9:{s:14:"transaction_id";s:9:"R-001.440";s:6:"rating";s:1:"5";s:11:"rating_room";N;s:14:"rating_service";N;s:15:"rating_catering";N;s:15:"rating_ambience";N;s:7:"message";s:36:"Schnelle, professionelle Abwicklung!";s:7:"comment";s:0:"";s:9:"delivered";s:19:"2012-07-03 14:24:45";}i:7;a:9:{s:14:"transaction_id";s:9:"R-001.441";s:6:"rating";s:1:"5";s:11:"rating_room";N;s:14:"rating_service";N;s:15:"rating_catering";N;s:15:"rating_ambience";N;s:7:"message";s:36:"Schnelle, professionelle Abwicklung!";s:7:"comment";s:0:"";s:9:"delivered";s:19:"2012-07-03 14:24:26";}i:8;a:9:{s:14:"transaction_id";s:9:"R-001.428";s:6:"rating";s:1:"5";s:11:"rating_room";N;s:14:"rating_service";N;s:15:"rating_catering";N;s:15:"rating_ambience";N;s:7:"message";s:34:"Schnelle professionelle Umsetzung!";s:7:"comment";s:0:"";s:9:"delivered";s:19:"2012-06-28 08:00:26";}i:9;a:9:{s:14:"transaction_id";s:9:"R-001.429";s:6:"rating";s:1:"5";s:11:"rating_room";N;s:14:"rating_service";N;s:15:"rating_catering";N;s:15:"rating_ambience";N;s:7:"message";s:34:"Schnelle professionelle Umsetzung!";s:7:"comment";s:0:"";s:9:"delivered";s:19:"2012-06-28 08:00:02";}}s:4:"done";i:1;s:7:"done_at";i:1342258698;}');
var_dump($test);

Ausgabe: array(4) {   ["info"]=>   array(11) {     ["account_name"]=>     string(15) "Immoticket24.de"     ["ekomi_certificate"]=>     string(41) "https://www.ekomi.de/cert/6R65WJE7WW5HT3E"     ["ekomi_certificate_id"]=>     string(15) "6R65WJE7WW5HT3E"     ["ekomi_certificate_seo"]=>     string(52) "https://www.ekomi.de/bewertungen-immoticket24de.html"     ["fb_count"]=>     string(3) "410"     ["fb_avg"]=>     string(3) "4.8"     ["fb_avg_detail"]=>     string(6) "4.7951"     ["fb_avg_room"]=>     float(0)     ["fb_avg_service"]=>     float(0)     ["fb_avg_catering"]=>     float(0)     ["fb_avg_ambience"]=>     float(0)   }   ["feedbacks"]=>   array(10) {     [0]=>     array(9) {       ["transaction_id"]=>       string(9) "R-001.462"       ["rating"]=>       string(1) "5"       ["rating_room"]=>       NULL       ["rating_service"]=>       NULL       ["rating_catering"]=>       NULL       ["rating_ambience"]=>       NULL       ["message"]=>       string(132) "Alles bestens, einfache Anwendung, gute Info über die einzelnen Schritte. Veröffentlichungen über verschiedene Quellen sehr zeitnah."       ["comment"]=>       string(0) ""       ["delivered"]=>       string(19) "2012-07-12 16:34:58"     }     [1]=>     array(9) {       ["transaction_id"]=>       string(9) "R-001.211"       ["rating"]=>       string(1) "5"       ["rating_room"]=>       NULL       ["rating_service"]=>       NULL       ["rating_catering"]=>       NULL       ["rating_ambience"]=>       NULL       ["message"]=>       string(108) "sehr gutes Preis- / Leistungsverhältnis bei einem einwandfreien persönlichen Kundenservice. Jederzeit wieder"       ["comment"]=>       string(0) ""       ["delivered"]=>       string(19) "2012-07-12 08:56:51"     }     [2]=>     array(9) {       ["transaction_id"]=>       string(9) "R-001.465"       ["rating"]=>       string(1) "5"       ["rating_room"]=>       NULL       ["rating_service"]=>       NULL       ["rating_catering"]=>       NULL       ["rating_ambience"]=>       NULL       ["message"]=>       string(51) "Perfekter persönlicher Service. Besser gehts nicht!"       ["comment"]=>       string(0) ""       ["delivered"]=>       string(19) "2012-07-09 18:24:41"     }     [3]=>     array(9) {       ["transaction_id"]=>       string(9) "R-001.466"       ["rating"]=>       string(1) "5"       ["rating_room"]=>       NULL       ["rating_service"]=>       NULL       ["rating_catering"]=>       NULL       ["rating_ambience"]=>       NULL       ["message"]=>       string(134) "Ich wurde umgehend persönlich kontaktiert und meine Buchungswünsche wurden perfekt umgesetzt. Bei dem Preis ein unschlagbares Angebot!"       ["comment"]=>       string(0) ""       ["delivered"]=>       string(19) "2012-07-09 18:23:47"     }     [4]=>     array(9) {       ["transaction_id"]=>       string(9) "R-001.445"       ["rating"]=>       string(1) "5"       ["rating_room"]=>       NULL       ["rating_service"]=>       NULL       ["rating_catering"]=>       NULL       ["rating_ambience"]=>       NULL       ["message"]=>       string(135) "Wirklich nicht mehr zu verbessern; weiter so. Habe die Empfehlung von meinem Schwiegervater bekommen (BJ 44). Kann es kaum glauben. ;-)"       ["comment"]=>       string(0) ""       ["delivered"]=>       string(19) "2012-07-06 08:57:33"     }     [5]=>     array(9) {       ["transaction_id"]=>       string(9) "R-001.442"       ["rating"]=>       string(1) "5"       ["rating_room"]=>       NULL       ["rating_service"]=>       NULL       ["rating_catering"]=>       NULL       ["rating_ambience"]=>       NULL       ["message"]=>       string(57) "Tolle Idee, toller Kundenservice, absolut empfehlenswert!"       ["comment"]=>       string(0) ""       ["delivered"]=>       string(19) "2012-07-05 09:54:21"     }     [6]=>     array(9) {       ["transaction_id"]=>       string(9) "R-001.440"       ["rating"]=>       string(1) "5"       ["rating_room"]=>       NULL       ["rating_service"]=>       NULL       ["rating_catering"]=>       NULL       ["rating_ambience"]=>       NULL       ["message"]=>       string(36) "Schnelle, professionelle Abwicklung!"       ["comment"]=>       string(0) ""       ["delivered"]=>       string(19) "2012-07-03 14:24:45"     }     [7]=>     array(9) {       ["transaction_id"]=>       string(9) "R-001.441"       ["rating"]=>       string(1) "5"       ["rating_room"]=>       NULL       ["rating_service"]=>       NULL       ["rating_catering"]=>       NULL       ["rating_ambience"]=>       NULL       ["message"]=>       string(36) "Schnelle, professionelle Abwicklung!"       ["comment"]=>       string(0) ""       ["delivered"]=>       string(19) "2012-07-03 14:24:26"     }     [8]=>     array(9) {       ["transaction_id"]=>       string(9) "R-001.428"       ["rating"]=>       string(1) "5"       ["rating_room"]=>       NULL       ["rating_service"]=>       NULL       ["rating_catering"]=>       NULL       ["rating_ambience"]=>       NULL       ["message"]=>       string(34) "Schnelle professionelle Umsetzung!"       ["comment"]=>       string(0) ""       ["delivered"]=>       string(19) "2012-06-28 08:00:26"     }     [9]=>     array(9) {       ["transaction_id"]=>       string(9) "R-001.429"       ["rating"]=>       string(1) "5"       ["rating_room"]=>       NULL       ["rating_service"]=>       NULL       ["rating_catering"]=>       NULL       ["rating_ambience"]=>       NULL       ["message"]=>       string(34) "Schnelle professionelle Umsetzung!"       ["comment"]=>       string(0) ""       ["delivered"]=>       string(19) "2012-06-28 08:00:02"     }   }   ["done"]=>   int(1)   ["done_at"]=>   int(1342258698) }

Der String ist also o.k. und unserializeable.

mfg

tami