path= $filepath; if(file_exists($filepath)){ if(unlink($filepath)) { $ret->status="success"; $ret->msg="Agent Removed!!"; } else { $ret->status = "error"; $ret->msg= "Error in removing user"; } } else $ret->msg= "File not found"; echo json_encode($ret); ?>