Jump to content

Need PHP to Return My JSON Object


unemployment

Recommended Posts

Do you guys know how I can get php to return this JSON Object properly?

 

My current script fails.

 


<?php 

if (isset($_GET['page']) && $_GET['page'] == "featured")
{

?>
{	"equipments" : [
			{"id" : 1234567,
			"name" : "Articulating Boom Lift",
			"specUrl" : "/data/spec/equip1.pdf",
			"summary" : "Varying heights: 20' - 60' with emissions free operation, heights to 80' with diesel/dual fuel systems and 150' with diesel; Available in electric, gas, propane or diesel; Large work platforms with up to 500 lb. capacity; 4-wheel drive and rough terrain models available.",
			"description" : "Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum. Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur.",
			"quantity" : 1,
			"existInCart" : false,
			"cartTransactionId" : 6509299203
		}
	]
}
<?php 

}
if (isset($_GET['page']) && $_GET['page'] == "tropical")
{

?>
{	"equipments" : [
			{"id" : 55727,
			"name" : "Bucket Truck",
			"specUrl" : "/data/spec/equip1.pdf",
			"summary" : "Available two man platforms; Platform leveling system; Available height range 34' - 51'; Outrigger & backup warning alarms; Tool lines at boom; 12V emergency operating system",
			"description" : "Equipment availability may be limited and rental rates are subject to change without notice. Taxes and additional costs and or fees, such as refueling, Loss and Damage Waiver, and delivery are extra when applicable. All terms and conditions of the Hertz Equipment Rental contract will apply.",
			"quantity" : 1,
			"existInCart" : false,
			"cartTransactionId" : 6509299222
		}
	]
}
<?php

}

?>

Link to comment
https://forums.phpfreaks.com/topic/266875-need-php-to-return-my-json-object/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.