// example POST request
//
// [{"salesid":130201411173700750}]
//
//
$jsonString = '[{"salesid":130201411173700750}]';
// PHP code
$payments = json_decode(stripslashes(html_entity_decode(rtrim($jsonString, '\0'))), true);
$values = '';
foreach ($payments as $key => $value) {
$value = (object)$value;
if ($values != '') {
$values .= ',';
}
printResponse(false, "sales id: $value->salesid");
exit;
//more code omitted...
}
function printResponse($success, $data, $totalCount = 0) {
header('Content-Type: application/json;charset=UTF-8');