0

My External JSON File is

[{"refid": 1,"name": "bala 1","address": "","cityname": "india","statename": "","contact_num": 0,"emailid": "","img_field": "","last_modified": "2013-02-11 15:28:41","created_date": "2013-02-26","stat": "A"}, {"refid": 2,"name": "sathish","address": "","cityname": "india","statename": "","contact_num": 0,"emailid": "","img_field": "","last_modified": "2013-08-20 17:01:11","created_date": "2013-08-20","stat": "A"}]

and my PHP code

$json_string = file_get_contents("client_master.json");
$parsed_json = json_decode($json_string, true);
var_dump($parsed_json);

if (is_array($users) || is_object($users))
{
    foreach ($parsed_json as $field => $value) {
        // Use $field and $value here
        echo $filed ."as ".$value;
    }
}
else{
    echo mysql_error();
}

my .json file .php file is there same folder ,

Php script return result as NULL how to access this json file in php ? pls explain and mention my mistake in php file

MH2K9
  • 11,951
  • 7
  • 32
  • 49
Balakumar B
  • 770
  • 5
  • 17
  • 41

0 Answers0