Answer the question
In order to leave comments, you need to log in
How to parse pseudo JSON to js?
"a:3:{i:0;a:9:{s:13:"option_name_t";s:18:"Пенсионер";s:14:"option_price_t";s:3:"200";s:12:"option_qty_t";s:2:"10";s:12:"option_rsv_t";s:1:"0";s:20:"option_default_qty_t";s:1:"0";s:17:"option_qty_t_type";s:8:"inputbox";s:20:"option_sale_end_date";s:10:"2021-03-14";s:20:"option_sale_end_time";s:5:"00:00";s:22:"option_sale_end_date_t";s:16:"2021-03-14 00:00";}i:1;a:9:{s:13:"option_name_t";s:30:"Ребёнок (до 8 лет)";s:14:"option_price_t";s:3:"700";s:12:"option_qty_t";s:2:"10";s:12:"option_rsv_t";s:1:"0";s:20:"option_default_qty_t";s:1:"0";s:17:"option_qty_t_type";s:8:"inputbox";s:20:"option_sale_end_date";s:10:"2021-03-14";s:20:"option_sale_end_time";s:5:"00:00";s:22:"option_sale_end_date_t";s:16:"2021-03-14 00:00";}i:2;a:9:{s:13:"option_name_t";s:14:"Обычный";s:14:"option_price_t";s:4:"1500";s:12:"option_qty_t";s:2:"10";s:12:"option_rsv_t";s:1:"0";s:20:"option_default_qty_t";s:1:"0";s:17:"option_qty_t_type";s:8:"inputbox";s:20:"option_sale_end_date";s:10:"2021-03-14";s:20:"option_sale_end_time";s:5:"00:00";s:22:"option_sale_end_date_t";s:16:"2021-03-14 00:00";}}"
Answer the question
In order to leave comments, you need to log in
Depends on how often revisions and format changes are expected. If not often, then you can just mess with your parser with regular expressions, replace and split.
If there is access to API developers, then you can ask them what kind of format it is, alternative json. If they did not invent it themselves and it has some name, then in Google it will be possible to google the library for parsing it.
PS: Here's what Google suggests
https://stackoverflow.com/questions/29815871/what-...
https://stackoverflow.com/questions/14227388/unser...
https://locutus.io/php/var /unserialize/
It looks like the native PHP serialize function .
There is no standard way to deserialize such data in JS, you need to write your own function or google the finished one.
Your example decodes as:
[
{
option_default_qty_t: "0",
option_name_t: "Пенсионер"
option_price_t: "200",
option_qty_t: "10",
option_qty_t_type: "inputbox",
option_rsv_t: "0",
option_sale_end_date: "2021-03-14",
option_sale_end_date_t: "2021-03-14 00:00",
option_sale_end_time: "00:00",
}, {
option_default_qty_t: "0",
option_name_t: "Ребёнок (до 8 лет)",
option_price_t: "700",
option_qty_t: "10",
option_qty_t_type: "inputbox",
option_rsv_t: "0",
option_sale_end_date: "2021-03-14",
option_sale_end_date_t: "2021-03-14 00:00",
option_sale_end_time: "00:00",
}, {
option_default_qty_t: "0",
option_name_t: "Обычный",
option_price_t: "1500",
option_qty_t: "10",
option_qty_t_type: "inputbox",
option_rsv_t: "0",
option_sale_end_date: "2021-03-14",
option_sale_end_date_t: "2021-03-14 00:00",
option_sale_end_time: "00:00",
}
]
It can also be done in html. On css via keyframe. On js through velocity for example (well, or write animation with pens). In general, there are a lot of options: a demo on jquery taking into account the length of the text , a tutorial on creating in pure css , information about the html tag .
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question