returnJson(); 추가

This commit is contained in:
2018-01-29 21:46:44 +09:00
parent 55d15bb562
commit a78d93f282
3 changed files with 30 additions and 23 deletions
+14
View File
@@ -135,6 +135,20 @@ function Error($message, $url="") {
exit;
}
function returnJson($value, $pretty = false, $die = true){
header('Content-Type: application/json');
if($pretty){
$flag = JSON_UNESCAPED_UNICODE | JSON_PRETTY_PRINT;
}
else{
$flag = JSON_UNESCAPED_UNICODE;
}
echo json_encode($value, $flag);
if($die){
die();
}
}
// 게시판의 생성유무 검사
function isTable($connect, $str, $dbname='') {
if(!$dbname) {