// render.js
var webPage = require('webpage');
var page = webPage.create();
page.viewportSize = {
width: 1920,
height: 1080
};
page.open('http://toster.com', function (status) {
var base64 = page.renderBase64('PNG');
console.log(base64);
phantom.exit();
});
setInterval(timeRun, 1000);
// Запускаем и одновременно запоминаем id запущенной операции
var timerId = setInterval(timeRun, 1000);
...
// Останавливаем
clearInterval(timerId);
select concat(message.useridfrom, '-', message.useridto) as huita from table ...
echo $c->huita; // 6-5
SELECT DATE_FORMAT(column_name, '%d/%m/%Y') FROM tablename
<?php
class foo{
private $arr;
public function __construct()
{
$this->arr = new MyArray();
}
public function __get($property){
if(empty($this->$property)){
return -1;
} else {
return $this->$property;
}
}
}
class MyArray implements ArrayAccess {
private $container = array();
public function __construct() {
$this->container = array(
1 => "one" ,
2 => "two",
);
}
public function offsetSet($offset, $value) {
if (is_null($offset)) {
$this->container[] = $value;
} else {
$this->container[$offset] = $value;
}
}
public function offsetExists($offset) {
return isset($this->container[$offset]);
}
public function offsetUnset($offset) {
unset($this->container[$offset]);
}
public function offsetGet($offset) {
return isset($this->container[$offset]) ? $this->container[$offset] : -666;
}
}
$a = new foo();
var_dump($a->arrzzzz);
var_dump($a->arr[2]);
var_dump($a->arr[3]);
$("#id_code").selectionStart = 1;
$("#id_code").selectionEnd = 1;
.cont-title {
background-color: green;
}
.cont-title a {
background-color: white;
display: inline-block;
}
.cart {
background-color: white;
}
<div class="cont-title">
<a href="#" class="cell">
<h1>Заголовок</h1>
</a>
<div class="cell cell--mid"></div>
<div class="cart cell">Дата</div>
</div>
.cont-title {
display: table;
}
.cell {
display: table-cell;
}
.mid {
width: 100%;
background-color: green;
}
date("m", strtotime("+1 month"));
Relative month values are calculated based on the length of months that they pass through. An example would be "+2 month 2011-11-30", which would produce "2012-01-30". This is due to November being 30 days in length, and December being 31 days in length, producing a total of 61 days.
$next_month = date("m")+1 > 12 ? 1 : date("m")+1;
$post_next_month = $next_month+1 > 12 ? 1 : $next_month+1;