Good day, gentlemen connoisseurs!
I have a block-div, with the class b-cat-marker js-schedule
. It has a data-ch
attribute that contains the information I need, looks like this:
<div class="b-cat-market js-schedule" data-ch="{"49":{"id":"49","title":"Первый канал - Евразия","logo":{"width":"38","height":"30","src":"http:\/\/ avatars.yandex.net \/get-tv-shows\/1333708610295M22586\/orig"}},"785":{"id":"785","title":"КТК","logo":{"width":"38","height":"30","src":"http:\/\/ avatars.yandex.net \/get-tv-shows\/1333712749673M29386\/orig"}},"528":{"id":"528","title":"Астана","logo":{"width":"38","height":"30","src":"http:\/\/ avatars.yandex.net \/get-tv-shows\/1333708111007M36576\/orig"}},"490":{"id":"490","title":"Седьмой канал","logo":{"... ndex.net \/get-tv-channel-logos\/1336217773495M65560\/orig"}},"614":{"id":"614","title":"Кухня ТВ","logo":{"width":"38","height":"30","src":"http:\/\/ avatars.yandex.net \/get-tv-shows\/1333708867834M98854\/orig"}},"153":{"id":"153","title":"Авто Плюс","logo":{"width":"38","height":"30","src":"http:\/\/ avatars.yandex.net \/get-tv-shows\/1333715566443M50909\/orig"}},"250":{"id":"250","title":"365","logo":{"width":"38","height":"30","src":"http:\/\/ avatars.yandex.net \/get-tv-shows\/1333713180776M42789\/orig"}}}">
As you already understood, I need to miraculously turn this attribute into an array, for example
$data["position"]=49; $data["id"]=49; $data["title"]=".....";
PS: no experience in regexp.