PHP Parse URL-encoded string with embedded JSON -
i having problem parsing following xapi string array. issue both parse_str() , parse_url() parse url within quotes contained in [content] ... kills json format.
authorization=basic ymv0b1234xzlddle9ighrxrvc3vhdmvwy999929yza==&content-type=application/json&x-experience-api-version=1.0.0&statementid=ef0ca1d6-1234-4e02-b403-7d4aab0df62c&content={"verb":{"id":"http://adlnet.gov/expapi/verbs/experienced"},"object":{"id":"http://mytest.myfavsite.com/?post_type=gb_xapi_content&p=52&preview=true/6lgix5hxep0","definition":{"name":{"und":"specificstatement"},"description":{"und":"specificstatement"},"type":"http://adlnet.gov/expapi/activities/module"},"objecttype":"activity"},"context":{"contextactivities":{"grouping":{"id":"http://mytest.myfavsite.com/?post_type=gb_xapi_content&p=52&preview=true"},"parent":{"id":"http://mytest.myfavsite.com/?post_type=gb_xapi_content&p=52&preview=true"}},"registration":"36fc1ee0-2849-1234-b697-71cd4cad1b6e"},"version":"1.0.0","actor":{"mbox":"mailto:betosuave@home.tld","name":"beto","objecttype":"agent"}}
what wind-up array of element intact json string in [content] array element.
is there method of parsing string parse_str() ... while ignoring inside quotes of json element - e.g., {"id":"http://mytest.myfavsite.com/?post_type=gb_xapi_content&p=52&preview=true"}
thank in-advance ideas.
try json_decode($string)
first , run parse_str()
on selected element.
Comments
Post a Comment