Registers a function that will be executed right before the PHP process stops execution
register_shutdown_function('myexit');

function myexit()
{
	echo "</schedule>";
}
by Valeri Tandilashvili
4 years ago
PHP
functions
PHP official doc
1
Pro tip: use ```triple backticks around text``` to write in code fences