Jump to content

[SOLVED] Parsing JSON


jjacquay712

Recommended Posts

what do you mean parse JSON?...to get data from it?

 

thats extremely simple...its just like an array in PHP:

 

<script type="text/javascript">
Simple Array:
var data = {"key1":"value1", "key2":"value2"};
alert(data['key2']);//will alert "value2"

Multi-Dimensional Array
var data = {"key1":"value1", "key2":{"key1ofKey2":"value1extended", "key2ofKey2":"value2extended"}};
alert(data['key2']['key1ofKey2']);//will alert "value1extended"
</script>

Link to comment
https://forums.phpfreaks.com/topic/162780-solved-parsing-json/#findComment-859377
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.