<?php
  header("Content-Type: application/json; charset=UTF-8");
  //echo "Mein Name lautet Stefan Seidel<br>";
  
  $object1["Frucht"]     ="Banane";
  $object2["Gemuese"]    ="Tomate";
  
  $array                = array("Banane", "Kirsche", "Pfirsich");
  
  $objectArray[]        = $object1;
  $objectArray[]        = $object2;
  
  $multiObject = $object1+$object2;
  
  $nested1["Frucht"] = $array;
  $nested2           = $object2;
  $nestedObject["Essbares"] = $nested1+$nested2;
  
  echo "object: " .json_encode($object1)."<br>".PHP_EOL;
  echo "array: " .json_encode($array)."<br>".PHP_EOL;
  echo "objectArray:". json_encode($objectArray)."<br>".PHP_EOL;
  echo "multiObject:". json_encode($multiObject)."<br>".PHP_EOL;
  echo "nestedObject:". json_encode($nestedObject)."<br>".PHP_EOL;
?>

