SELECT * FROM projects WHERE id > " . $post_id . " ORDER BY id ASC LIMIT 1";
SELECT * FROM projects WHERE id < " . $post_id . " ORDER BY id DESC LIMIT 1";
// read to EOF which may read more or less than buffer size
while ((n = read(buf, nread, Math.min(buf.length - nread, remaining))) > 0) {
nread += n;
remaining -= n;
}
$sorted = []; // Результирующий массив
foreach ($lines as $line) { // $line[0] - old, $line[1] - new
$sorted[$line[1]]['old'] = $line[1];
$sorted[$line[1]]['new'][] = $line[0];
}
function no_json_decode($encoded) {
$decoded = [];
foreach (explode('","', trim($encoded, '{}')) as $element) {
list($key, $value) = explode(':', $element);
$decoded[trim($key, '"')] = trim($value, '"');
}
return $decoded;
}
Array
(
[tx] => 5204759
[status] => SUCCESS
[date] => 04.07.2017
[time] => 21
[cash] => 7 210,00руб.
[orig] => 7 000,00руб.
[provider] => WebmoneyОАОБанк"ККБ
[opnum] => R14702331
[comment] =>
)