<?php
/*Servo Recipe*/
/*Recipe Name: Dynamic AJAX response*/
/*Recipe Description: This recipe first disables the browser's cache so that the cache does not attempt to store the results of this script. Then a simple object is created which will change every second, then the object is used to make a JSON string and set back to the browser.*/
/*Servo Recipe*/
?>

<?php
/*s3rvo_functiondef_ZCTHEMWBVY*/
/*Title: Disable browser cache*/
/*Object: escapers_disable_browser_cache.json*/
/*Description: Sends headers to browser which should disable the browser cache*/
/*Tint: #341537*/
function aer_disable_cache() {

	header('Cache-Control: no-cache, no-store, must-revalidate'); // HTTP 1.1.
	header('Pragma: no-cache'); // HTTP 1.0.
	header('Expires: 0'); // Proxies.
}
/*s3rvo_functiondef_ZCTHEMWBVY*/


/*s3rvo_functioncall_OMASFTGHWG*/
/*Title: Disable browser cache*/
/*Object: escapers_disable_browser_cache.json*/
/*Description: Sends headers to browser which should disable the browser cache*/
/*Tint: #341537*/
servo_disable_cache();
/*s3rvo_functioncall_OMASFTGHWG*/









/*s3rvo_functiondef_KPDPMLCAQQ*/
/*Title: Encode as JSON*/
/*Object: escapers_encode_as_json.json*/
/*Description: Returns the PHP object as a JSON string*/
/*Tint: #554411*/
function aer_json_encode($object) {
	return json_encode($object);
}
/*s3rvo_functiondef_KPDPMLCAQQ*/

/*s3rvo_usercode_VIELAMFLVJ*/
/*Title: Make a simple object which will change each call*/
/*Description: A simple PHP array which supplies the time on the server.*/
/*Tint: #772233*/
//code
$object = ["servertime",time()];
//code

/*s3rvo_usercode_VIELAMFLVJ*/


/*s3rvo_functioncall_NBGSEBGEFL*/
/*Title: Encode as JSON*/
/*Object: escapers_encode_as_json.json*/
/*Description: Returns the PHP object as a JSON string*/
/*Tint: #554411*/
/*s3rvo_return_value*/echo /*s3rvo_return_value*/servo_json_encode(
/*s3rvo_param_$object*/$object/*s3rvo_param_$object*/
);
/*s3rvo_functioncall_NBGSEBGEFL*/


?>