$string = 'Задолженность: 1138509.21 руб. Исполнительский сбор: 79695.67 руб.';
$dolg = $sbor = null;
if(preg_match_all('/([0-9]*[.])?[0-9]+/uis', $string, $matches)) {
[$dolg, $sbor] = $matches[0];
}
const arrayNumbers = [-5, 0, 5, 10, 15, 20, 25, 30, 35]
const n = 23.45
const buf = arrayNumbers.map(number => { return Math.abs(n - number); });
const res = arrayNumbers[buf.indexOf(Math.min(...buf))];
console.log(res);
let buf = '';
for(let i = 0; i < params.projects.length; i++) {
// Здесь this.archiveProjectCart почему то не выводит
buf += this.archiveProjectCart(params.projects[i])
}
let html = `
<div class="archive-works__wrap">
<p class="archive-works__year">${params.year}</p>
<div class="archive-works__items">${buf}</div>
</div>
`
return html
function docker-npm() {
docker run -it --rm -v app-sync:/var/www/sites:nocopy -w=$(pwd) node npm "$@"
}
// -v app-sync:/var/www/sites:nocopy на свое правим
public function index()
{
$categories = ...;
echo self::getTree($categories);
}
public static function getTree($categories, $parent_id = 0) // или null, смотря что по дефолту
{
$result = '';
foreach ($categories as $category) {
if ($category->parent != $parent_id) {
continue;
}
$result .= sprintf('<li><a>%s</a>%s</li>',
$category->name,
self::getTree($categories, $category->categories_id) // или $category->id, смотря где там id
);
}
return $result ? sprintf('<ul>%s</ul>', $result) : '';
}
SELECT * FROM `users`
LEFT join `user_attributes` on user_attributes.user_id = users.id
where
user_attributes.gender = 2
and user_attributes.city = "Витебск"
and user_attributes.age BETWEEN 18 and 25
and not exists (select * from likes where likes.like_user = users.id)
LIMIT 4
.partys .slick-prev:before {
content: '<-';
}
.partys .slick-next:before {
content: '->';
}