I have an array that have values as usual in PHP. But in a field of a array there is json data and im not able to unserialize the data in order to get a specific element.
The array have a field that is named "__viewstate" that have the data i want, the data i want to get is the number "+46736506234" but im not able to unserialize the data, all I get is bool false but i guess because its wrong formated.
How could I proceed to in order to get the phonenumber from this data?:
I am using var_dump($this)
to get the posted content on the confirmation page, var_dump($_POST)
gives the same array.
["__viewstate"]=> string(974) "a:4:{i:0;a:1:{s:9:\"projectId\";i:4;}i:1;a:15:{s:14:\"availabilityId\";i:6;s:13:\"availableDate\";s:10:\"2019-05-29\";s:7:\"endDate\";s:10:\"2019-05-29\";s:9:\"startTime\";s:4:\"2569\";s:7:\"endTime\";N;s:13:\"startTimeslot\";s:8:\"10:30 am\";s:11:\"endTimeslot\";s:0:\"\";s:5:\"seats\";i:4;s:12:\"seatsMinimum\";i:1;s:12:\"seatsMaximum\";i:10;s:13:\"dynamicFields\";a:0:{}s:8:\"timezone\";s:16:\"Europe/Stockholm\";s:15:\"_availabilityId\";N;s:14:\"_availableDate\";N;s:8:\"_endDate\";N;}i:6;a:1:{s:9:\"requestId\";s:41:\"calendarista_req_1557482130_5cd54a92b61bd\";}i:4;a:9:{s:12:\"formelements\";a:1:{i:0;a:5:{s:9:\"projectId\";i:4;s:9:\"elementId\";i:6;s:10:\"orderIndex\";i:6;s:5:\"value\";s:10:\"+46736506234\";s:5:\"label\";s:11:\"Phonenumber\";}}s:6:\"userId\";i:0;s:4:\"name\";s:10:\"Firstname Lastname\";s:9:\"firstname\";s:5:\"Firstname\";s:8:\"lastname\";s:4:\"Lastname\";s:5:\"email\";s:13:\"info@Firstname.se\";s:12:\"customerType\";i:0;s:11:\"billingInfo\";a:0:{}s:5:\"Mobil\";N;}}"
The whole array is:
array(14) { ["projectId"]=> string(1) "4" ["calendarMode"]=> string(1) "1" ["postbackStep"]=> string(8) "checkout" ["previewUrl"]=> string(0) "" ["__viewstate"]=> string(997) "a:4:{i:0;a:1:{s:9:\"projectId\";i:4;}i:1;a:15:{s:14:\"availabilityId\";i:6;s:13:\"availableDate\";s:10:\"2019-05-31\";s:7:\"endDate\";s:10:\"2019-05-31\";s:9:\"startTime\";s:4:\"2627\";s:7:\"endTime\";N;s:13:\"startTimeslot\";s:8:\"10:30 am\";s:11:\"endTimeslot\";s:0:\"\";s:5:\"seats\";i:4;s:12:\"seatsMinimum\";i:1;s:12:\"seatsMaximum\";i:6;s:13:\"dynamicFields\";a:0:{}s:8:\"timezone\";s:16:\"Europe/Stockholm\";s:15:\"_availabilityId\";N;s:14:\"_availableDate\";N;s:8:\"_endDate\";N;}i:6;a:1:{s:9:\"requestId\";s:41:\"calendarista_req_1557484124_5cd5525ca8249\";}i:4;a:9:{s:12:\"formelements\";a:1:{i:0;a:5:{s:9:\"projectId\";i:4;s:9:\"elementId\";i:6;s:10:\"orderIndex\";i:6;s:5:\"value\";s:11:\"96146734834\";s:5:\"label\";s:11:\"Phonenumber\";}}s:6:\"userId\";i:0;s:4:\"name\";s:17:\"Firstname Lasname\";s:9:\"firstname\";s:9:\"Firstname\";s:8:\"lastname\";s:7:\"Lasname\";s:5:\"email\";s:22:\"someEmail@dotemail.com\";s:12:\"customerType\";i:0;s:11:\"billingInfo\";a:0:{}s:5:\"Mobil\";N;}}" ["stagingId"]=> string(0) "" ["requestId"]=> string(41) "calendarista_req_1557484124_5cd5525ca8249" ["projectList"]=> string(1) "4" ["calendarista_cart"]=> string(0) "" ["controller"]=> string(21) "calendarista_checkout" ["paymentsMode"]=> string(2) "-1" ["originalCost"]=> string(1) "0" ["totalAmountBeforeDiscount"]=> string(1) "0" ["booknow"]=> string(0) "" }
I expect something like this "__viewstats" => (phonenumber data)