task 2,3: XML->Json, SQL TAble -> JSON
This commit is contained in:
19
Zweites Jahr/json/createJsonFile.php
Normal file
19
Zweites Jahr/json/createJsonFile.php
Normal file
@@ -0,0 +1,19 @@
|
||||
<?php
|
||||
ini_set('display_errors', 1);
|
||||
ini_set('display_startup_errors', 1);
|
||||
error_reporting(E_ALL);
|
||||
|
||||
$phpArr = [
|
||||
"vorname" => "Daniel",
|
||||
"nachname" => "C",
|
||||
"schule" => "wvss",
|
||||
"hatFuehrerschein" => true,
|
||||
"alter" => 67
|
||||
];
|
||||
|
||||
|
||||
$phpJson = json_encode($phpArr);
|
||||
echo "arr into json transfered<br>";
|
||||
|
||||
$file = file_put_contents("daniel.json", $phpJson);
|
||||
echo "file created<br>";
|
||||
Reference in New Issue
Block a user