"Language not requested. Please pass the GET parameter 'language'."); } if(isset($_POST['code'])) { $code = $_POST['code']; if($_POST['code'] == '') { $code = "if(true) { echo 'hello'; }"; } elseif(empty(trim($code))) { return array( "error" => "No code provided to analyze. Please pass the POST parameter 'code'."); } } switch (strtolower($language)) { case 'php': include ("cc_php.php"); break; default: return array("error" => "Language not supported."); } return array("value" => calculate($code)); } echo json_encode(process());