Hi !
On of the tutorial pages
https://www.w3schools.com/js/js_json_html.asp
is missing code of php file. As I understand the code should be the same as on previous page of chapter, like:
<?php
$myObj->name = "John";
$myObj->age = 30;
$myObj->city = "New York";
$myJSON = json_encode($myObj); echo $myJSON; ?>
Sincerely,
Alejandro.