Skip to content

Instantly share code, notes, and snippets.

@x22element
Created February 27, 2019 17:07
Show Gist options
  • Save x22element/4eec614f3dedb301a800d6f384e0b8b3 to your computer and use it in GitHub Desktop.
Save x22element/4eec614f3dedb301a800d6f384e0b8b3 to your computer and use it in GitHub Desktop.
<?php
private function response($aData,$isError = false, $redirectTo = false){
$aResult = [
'success' => $isError ? 'false' : 'true',
'data' => []
];
if(is_array($aData))
{
foreach ($aData as $key => $val)
{
$aResult['data'][$key] = $val[0];
}
} else {
$aResult['data']['response'] = $aData;
}
if($redirectTo)
{
$aResult['data']['href'] = $redirectTo;
}
exit (json_encode($aResult, JSON_UNESCAPED_UNICODE));
}
@x22element
Copy link
Author

ROFLLLL. Combowhore Result

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment