try {
for($i = 0; $i < 5000 ;$i++ ){
echo $i.' ';
}
} catch (Exception $e) {
echo $e->getMessage(), "\n";
}
$serialArr = serialize($arr);
$serialArr = json_encode($arr);
$content = '<div class="container">
<div class="box">
..... (some code)
</div>
<div class="box">
..... (some code)
</div>
<div class="box">
..... (some code)
</div>
<div class="box">
..... (some code)
</div>
</div>';
preg_match("#<div class=\"container\">(.+?)\n<\/div>#is", $content, $res);
var_dump($res);
$("#form1").submit(function() {
$.ajax({
type: "POST",
url: "send.php",
data: $(this).serialize(),
success: function(data){
$("#form1").find("input").val("");
alert("Спасибо за заявку! Скоро мы с вами свяжемся.");
$("#form1").trigger("reset");
}
});
return false;
});
--
-- Структура таблицы `test`
--
CREATE TABLE IF NOT EXISTS `test` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`title` text NOT NULL,
`created_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
`views` int(11) NOT NULL,
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=5 ;
--
-- Дамп данных таблицы `test`
--
INSERT INTO `test` (`id`, `title`, `created_at`, `views`) VALUES
(1, 'Test 1', '2017-03-09 13:34:19', 436),
(2, 'Test 2', '2017-03-01 13:34:19', 21),
(3, 'Title 3', '2017-03-01 13:38:07', 23),
(4, 'Title 4', '2017-03-03 13:38:07', 66);
SELECT created_at, SUM(views)
FROM `test`
WHERE created_at >= DATE('2017-02-01')
AND created_at <= DATE('2017-03-18')
GROUP BY DATE(created_at)
$str = explode(', ', '110, 50, 42, 69');
foreach($str as $val){
echo '<div id="bus_tag">' . $val . '</div>';
}