PHP 7 Script to Extract Data From JSON File Using json_decode() Method in Browser Full Project For Beginners

  • Post author:
  • Post category:PHP
  • Post comments:0 Comments

 

 

index.php

 

 

<?php 
$jsonString ='{
    "firstName":"Olivia",
    "lastName":"Mason",
    "dateOfBirth":
    {
        "year":"1999",
        "month":"06",
        "day":"19"
    }
}';
$data = json_decode($jsonString);
echo("The data is: \n");
var_dump($data);
?>

Leave a Reply