Created
June 23, 2016 14:33
-
-
Save tomtobac/a9fa24e91f77b9c5f30ee7b8442241a8 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
$obj = array( | |
"Name" => "Jon Snow", | |
"Info" => array( | |
"Age" => "17", | |
"House" => "Winterfell" | |
), | |
"Current Duty" => "Lord Commander" | |
); | |
$obj["Family"] = array( | |
array("Member" => "Arya Stark"), | |
array("Member" => "Sansa Stark") | |
); | |
array_push($obj["Family"], array("Member" => "Bran Stark")); | |
echo "<pre>" . json_encode($obj) . "</pre>"; | |
?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Simple Array to json object.