- rtrim: documentation ( source)
- stripslashes: documentation ( source)
- json_decode: documentation ( source)
- html_entity_decode: documentation ( source)
<?php
$jsonString = '[{"salesid":130201411173700750}]';
$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...
}