PHP 7 Script to Read and Parse JSON File Data From a REST API in Browser Full Project For Beginners

  • Post Author:
  • Post Category:PHP
  • Post Comments:0 Comments


Welcome folks today in this blog post we will be reading and parsing json file data from a rest api in browser using php 7. All the full source code of the application is shown below.




Get Started




In order to get started you need to make an index.php file and copy paste the following code






$jsonfile = file_get_contents("");

$jsonIterator = new RecursiveIteratorIterator(
    new RecursiveArrayIterator(json_decode($jsonfile, TRUE)),

foreach ($jsonIterator as $key => $value) {
    if(is_array($value)) {
        echo "$key:\n";
  else {
        echo "$key => $value\n";




Here you can change the password in the above php script


Leave a Reply