<?php
$array = array(1, "hello", 1, "world", "hello");
$counter = array_count_values($array);
arsort($counter);
print_r(array_slice($counter,0,20));
?>
Array
(
[1] => 2
[hello] => 2
[world] => 1
)
If a cache receives a value larger than the largest positive integer it can represent, or if any of its age calculations overflows, it MUST transmit an Age header with a value of 2147483648 (2^31)
Max-Age=value
OPTIONAL. The value of the Max-Age attribute is delta-seconds,
the lifetime of the cookie in seconds, a decimal non-negative
integer. To handle cached cookies correctly, a client SHOULD
calculate the age of the cookie according to the age calculation
rules in the HTTP/1.1 specification [RFC2616]. When the age is
greater than delta-seconds seconds, the client SHOULD discard the
cookie. A value of zero means the cookie SHOULD be discarded
immediately.
document.getElementById('myhref').ontouchstart = function (event)
{
var d = new Date();
this.touchStartTime = d.getTime();
event.preventDefault();
}
document.getElementById('myhref').ontouchend = function (event)
{
var d = new Date();
if ((d.getTime() - this.touchStartTime) < 1000 ) {
this.click();
}
}
Возвращает FALSE в случае неудачи. В случае успешного выполнения запросов SELECT, SHOW, DESCRIBE или EXPLAIN mysqli_query() вернет объект mysqli_result. Для остальных успешных запросов mysqli_query() вернет TRUE.
document.getElementById('mes').innerHTML += chat.value;
<?php
$ar = [
['items' => ['a', 'b', 'c']],
['items' => ['b', 'c']],
['items' => ['a']],
['items' => ['a', 'b', 'c', 'd']],
['items' => ['a']],
['items' => ['b']],
['items' => ['c']],
];
print_r(splitter($ar));
function splitter($array, $columns=3)
{
$return = array();
$per_column = intval(count($array) / $columns);
$i = 0;
$column = 0;
foreach ($array as $key => $row) {
if ($column < $columns-1) {
if ($i >= $per_column) {
$column++;
$i = 0;
}
}
$return[$column][] = $row;
$i++;
}
return $return;
}
Chart.plugins.register({
afterDatasetsDraw: function(chartInstance, easing) {
var ctx = chartInstance.chart.ctx;
chartInstance.data.datasets.forEach(function (dataset, i) {
var meta = chartInstance.getDatasetMeta(i);
if (!meta.hidden && dataset.type == 'line') {
// здесь код того что вы хотите реализовать
}
});
}
});
<?php
// хендлер реализаций
class WaybillHandler
{
protected $debug = true;
protected $db = null;
protected $socket = array();
protected $structure= array();
protected $doc = null;
protected $crmData = array();
public function __construct($waybill)
{
$this->db = DBPool::me()->getLink();
$this->doc = $waybill;
self::Handler();
}
private function Handler()
{
$db = $this->db;
// Если реализация не привязана к счету, то ничего не делаем
if ($this->doc['ДокументОснование']['#type'] != 'jcfg:DocumentRef.СчетНаОплатуПокупателю') {
return;
}
$this->structure = Utils1c::prepareStructure($this->doc,'waybill');
// Усли реализация поставлена на удаление, то автоматически будет отменена проводка
// либо мы вручную убрали проводку, а значит мы должны удалить запись из CRM
if ($this->doc['Posted'] == false) {
$this->structure['debug'][] = "Реализация не проведена, делаем попытку удаление данных"." (".__LINE__.")";
self::deleteWaybillFromCRM();
} else {
if (self::isRelatedToOurInvoice()) {
self::findDataFromCRMforWaybill();
if (count($this->crmData)) {
self::deleteWaybillDataOnDeleteInERP();
self::insertMissingWaybillDataToERP();
self::compareWaybillDataBetweenCRMandERP();
} else {
self::insertWaybillDataOnNewRowInERP();
}
self::updateStructureFinally();
} else {
$this->structure['debug'][] = "Мы не нашли связь между этой реализацией и счетами в CRM"." (".__LINE__.")";
}
}
if (!$this->debug) {
$this->structure['debug'] = array();
}
$this->socket[] = Driver1c::SOCKET_MARKER.json_encode($this->structure, JSON_UNESCAPED_UNICODE);
new WebSocketClient($this->socket);
return;
}
}
<span>
<span data-date="тут метка времени из базы"></span>
postgres=# select inet '192.168.0.100' <<= inet '192.168.0.0/24';
?column?
----------
t
(1 row)
postgres=# select inet '192.168.2.112' >= inet '192.168.0.0' AND inet '192.168.2.112' <= inet '192.168.10.255';
?column?
----------
t
(1 row)
postgres=#