<?php
$n = 10;
$cols = 3;
$step = floor($n/$cols); // Основной шаг между колонками
$long = $n%$cols; // Количество длинных колонок
$rows = $step+($long > 0 ? 1 : 0); // Количество строк
for ($i = 1; $i <= $rows; $i++) {
$val = $i; // Начальное значение строки
$col = ($i == $rows ? $long : $cols); // Количество колонок в строке
for ($j = 0; $j < $col; $j++) {
print "{$val}\t";
$val += $step+($j < $long ? 1 : 0); // Шаг к следующей колонке в строке
}
print "\n";
}
?>
SENDER="<$1>"
SHIFT=1
:0 c
* ^To:.*user@example.org
{
:0 c
* ^From:.*user@server1.ru
! -oi -f "$SENDER" spy@example.org
:0
* ^From:.*user@server2.ru
! -oi -f "$SENDER" spy@example.org
}
:0
! -oi -f "$SENDER" "$@"
curl_setopt($curl, CURLOPT_COOKIEFILE, "");
$cookies = curl_getinfo($curl, CURLINFO_COOKIELIST);
curl_setopt($curl, CURLOPT_COOKIE, $newCookies);
{'product_id' : 'count', 'product_id' : 'count}
SELECT `c`.`id`
FROM `chair` AS `c`
LEFT JOIN `tickets` AS `t` ON `t`.`chair_id` = `c`.`id`
AND :desiredTime < (`t`.`time_from` + INTERVAL 30 MINUTE)
AND `t`.`time_from` < (:desiredTime + INTERVAL 30 MINUTE)
WHERE `t`.`chair_id` IS NULL
/{\%(.*?\%})\%}/i
/{%([^{}%]*(?:(?R)|)[^{}%]*)%}/
SELECT `t2`.`number`, `t2`.`area` AS `newarea`, `t2`.`date` AS `lastdate`,
`t3`.`area` AS `oldarea`, `t3`.`date` AS `prevdate`
FROM (
SELECT `number`, MAX(`date`) AS `maxdate`
FROM `table`
GROUP BY `number`
) AS `t1`
JOIN `table` AS `t2` ON `t2`.`number` = `t1`.`number` AND `t2`.`date` = `t2`.`maxdate`
JOIN `table` AS `t3` ON `t3`.`number` = `t1`.`number` AND `t3`.`date` < `t3`.`maxdate`
AND `t3`.`area` < `t3`.`area`