$json_string = '{"historyList":[{"order_id":316052,"price":55,"previ_id":"109618","title":"\u0413\u043b\u0430\u0432\u043d\u044b\u0439 \u0430\u0434\u043c\u0438\u043d","date":"1434017352"},{"order_id":315443,"price":75,"previ_id":"109619","title":"\u0421\u043e\u0437\u0434\u0430\u0442\u0435\u043b\u044c","date":"1433997900"},{"order_id":306896,"price":300,"previ_id":"109625","title":"\u0412\u043b\u0430\u0434\u0435\u043b\u0435\u0446","date":"1433693384"},{"order_id":302606,"price":75,"previ_id":"109619","title":"\u0421\u043e\u0437\u0434\u0430\u0442\u0435\u043b\u044c","date":"1433530301"},{"order_id":302553,"price":25,"previ_id":"109610","title":"\u041a\u0440\u0435\u0430\u0442\u0438\u0432","date":"1433528927"}]}';
$some_data = json_decode($json_string);
if (!json_last_error() && !empty($some_data->historyList)) {
foreach ($some_data->historyList as $order) {
// Do something with $order
}
}
(x - x0)^2 + (y - y0)^2 <= R^2
$old_umask = umask(0);
mkdir($dir, 0777);
umask($old_umask);chown($dir, "your_user"); // Поменять владельца
chmod($dir, 0777); // Присвоить файлу другие права
$a === $b //TRUE если $a равно $b и имеет тот же тип.
<span class="price" data-default-currency-value="100">100 USD</span>
<span class="price" data-default-currency-value="500">500 USD</span>
<button class="recalculate" data-currency="EUR">Recalculate in EUR</button>
<button class="recalculate" data-currency="RUB">Recalculate in RUB</button>var currencyCoefficients = {
EUR: 1.1,
RUB: 65
};
$('.recalculate').on('click', function() {
var currency = $(this).data('currency');
$('.price').each(function() {
var value = $(this).data('default-currency-value');
var recalculatedValue = Math.ceil(value*currencyCoefficients[currency]);
$(this).html(recalculatedValue + ' ' + currency);
});
});