*/ $serviceURL = new URL($_SERVER['SERVER_NAME'].$_SERVER['REQUEST_URI']); $serviceURL->purgeEmptyParameters(); $serviceURL->format = 'xml'; echo " XML "; $serviceURL->format = 'json'; echo " JSON ";