$value){ $jsone['result'] = "Fail"; $jsone['message'] = "Length of " . $id . " should be less than ".$value+"(Chinese 5 words)"; echo json_encode($jsone); exit; } } function isNumeric($id,$value){ if($_REQUEST[$id] != ""){ if(!is_numeric($_REQUEST[$id])){ $jsone['result'] = "Fail"; $jsone['message'] = "You have entered a wrong value on " . $id . ", it should be numeric"; echo json_encode($jsone); exit; } if($_REQUEST[$id]>=$value){ $jsone['result'] = "Fail"; $jsone['message'] = "Value of " . $id . " should be less than ".$value; echo json_encode($jsone); exit; } } else{ $jsone['result'] = "Fail"; $jsone['message'] = "You should enter a value of " . $id; echo json_encode($jsone); exit; } } ?>