Posts

Showing posts with the label json to html

convert Json data to Php Array

How To convert Json data to Php Array json_decode ( ) - Decode JSON Formatted Data The json_decode() PHP function converts JSON data to PHP array data. Parameters data The json data that you want to decode in PHP. dataTypeBoolean Optional boolean that makes the function return a PHP Associative Array if set to "true", or return a PHP stdClass object if you omit this parameter or set it to "false". Both data types can be accessed like an array and use array based PHP loops for parsing. depth Optional recursion limit. Use an integer as the value for this parameter. options Optional JSON_BIGINT_AS_STRING parameter. A very simple example: <?php $jsonData = '{ "user":"John", "age":22, "country":"United States" }'; $phpArray = json_decode($jsonData); print_r($phpArray); foreach ($phpArray as $key => $value) {     echo "<p>$key | $value</p>"; } ...

How To Convert JSON Data Into Html Table Using Javascript jQuery

Image
In this tutorial i am going to explain about how to display the json data into html table using javascript & jquery. For explaining how we convert the json data into html table using javascript & jquery we have created a json file that contains the below json data. Json File [ {"Model" : "Iphone 18", "Name" : "iOS", "Share" : 57.56,"Price Range":"$800 - $1000","Brand":"Apple"},  {"Model" : "Nexus 23", "Name" : "Android", "Share" : 24.66,"Price Range":"$600 - $800","Brand":"Samsung"},  {"Model" : "Tom-tom", "Name" : "Java ME", "Share" : 10.72,"Price Range":"$200 - $900","Brand":"X Brand"}, {"Model" : "Nokia 66610", "Name" : "Symbian", ...