mod_respone function
Copy Below Code
View As A Text File
Show Text Only
Show API
Edit Code
function mod_respone($resp = true, $errorMsg = '', $otherResponseArr = [])
{
$successText = 'done';
if ($resp != true) {
$successText = 'error';
}
$respArr = ['success' => $successText, 'errormsg' => $errorMsg];
foreach ($otherResponseArr as $kk => $val) {
$respArr[$kk] = $val;
}
echo json_encode($respArr);
exit;
}