Using either javascript or php, how can I get a value from a webpage? This is the JSON I am attempting to parse:
{“error”:[“”],”templateHtml”:””,
“_visitor_conversationsUnread”:”0″,”_visitor_alertsUnread”:”0″}
I am trying to get the value of “_visitor_alertsUnread”.
How would I go about doing this?
Thank you!
You could either parse it using a regex, using json decoding, or simple indexing. However, of these three, json is the most clean and correct way to go.
1) JSON decoding:
2) Regular expression:
3) Indexing: