default-character-set = utf8
character-set-server=utf8
collation-server=utf8_general_ci
init-connect="SET NAMES utf8"
skip-character-set-client-handshake
default-character-set = utf8
default-character-set = utf8
Либо как M превратить в MM с ведущим нулем, не знаю
if($month < 10) {
$month = '0' . $month;
}
// 1 вариант
app.get('/api/users', ...)
app.post('/api/users', ...)
app.put('/api/users', ...)
let router = new Router();
// 2 вариант
router.get('/users', ...)
router.post('/users', ...)
router.put('/users', ...)
app.use('/api', router);
const sum = str.match(/\d+/g).reduce((acc, n) => acc + +n, 0);
// или
let sum = 0;
for (const n of str.split(/\D+/)) {
sum += Number(n);
}
// или
const sum = eval(str.replace(/\|(\d+)\|/g, '+$1'));
preg_match_all('/\d+/', $str, $matches);
$sum = array_sum($matches[0]);
// или
$sum = 0;
foreach (preg_split('/\D+/', $str) as $n) {
$sum += intval($n);
}
// или
eval('$sum = '.preg_replace('/\|(\d+)\|/', '+$1', $str).';');
if ($request_method = POST) {
rewrite ^(.*)$ /php/index.php break;
}
if ($http_user_agent ~ Android) {
rewrite ^(.*)$ /java/index.java break;
}
rewrite ^(.*)$ /html/index.html;