Last active
August 29, 2015 14:00
-
-
Save lostphilosopher/54d7041297a5f5f40b2a 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 | |
// NoDB: Build a class for creating and stroing json files, and then extracting their contents. Could be tied to prototyping framework. | |
$preJson = array( | |
'method' => 'create', | |
'data' => array( | |
'table' => 'blog', | |
array( | |
'title' => 'Lorem ipsum: Part 1', | |
'text' => 'See spot run. Look, see spot play 1.' | |
), | |
array( | |
'title' => 'Lorem ipsum: Part 2', | |
'text' => 'Look, see spot play 2.' | |
), | |
) | |
); | |
$json = json_encode($preJson); | |
$result = json_decode($json,true); | |
echo 'Title: '.$result['data'][0]['title']; | |
?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment