Created
August 28, 2008 16:48
-
-
Save mauritslamers/7770 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
$records = array(); | |
$ids = array(); | |
$products = array(); | |
$product_one = new stdClass; | |
$product_one->id=1; | |
$product_one->name="cheese"; | |
$product_one->price=1; | |
$product_two = new stdClass; | |
$product_two->id=2; | |
$product_two->name="ham"; | |
$product_two->price=2; | |
$records[] = $product_one; | |
$records[] = $product_two; | |
$jsonobject = new stdClass; | |
$jsonobject->records = $records; | |
$jsonobject->ids = $ids; | |
// $jsonobject->hello = 'world'; | |
// object assembled, so send | |
echo json_encode($jsonobject); | |
// echo "hello world"; | |
?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment