function array2Menu($items, $level = 0) {
$result = '';
foreach ($items as $item) {
$class= ""; // впишите свои классы в зависимости от $level
$result .= "<li class=\"$class\"><a href=\"{$item['code']}\">{$item['name']}</a>";
if (!empty($item['childs'])) {
$result .= array2Menu($item['childs'], $level + 1);
}
$result .= "</li>";
}
return "<ul class=\"level$level\">$result</ul>"; // тоже впишите свои классы в зависимости от $level
}
$(window).on('resize', myResizer);
$(document).on('ready', myResizer);
function myResizer(){
// ...
}
foreach ($products as $productJSON) {
$product = json_decode($productJSON, true);
?>
<div class="product">
<h2><?=$product['name']?><h2>
<p><?=$product['description']?></p>
<img src="/images/products/<?=$product['Preview_image']?>">
</div>
<?}
$response = [
'status': 'error', // или 'ok', тогда другие поля не указываются
// дальше статус по каждому из полей с ошибкой
'email': 'already_used', // или 'invalid' или еще какие-то ваши статусы
'phone': 'invalid'
];
return json_encode($response, $flags);
$ff['money'] = intval($ff['money']) - intval($ff1['money']);
let data = [
{id: 1, serial: "Blood.Drive", season: 1},
{id: 2, serial: "Blood.Drive", season: 1},
{id: 3, serial: "Foo.Bar", season: 1},
{id: 4, serial: "HelloWorld", season: 1},
]
let unique = data.reduce((acc,elem)=>acc.add(elem.serial), new Set())
console.log(unique)
https://jsfiddle.net/9Lunhds9/ new FormData(form);
А где ее записать тоВ командной строке вашего сервера, очевидно. Ну или в скрипте в вашем случае.
$('.btn-del').on('click', function(){ // на элементы с классом .btn-del вешается обработчик
$(this).closest('tr').remove(); // который находит ближаейший родительский tr и удаляет.
})
while ($curr_time < $target_time) {
usleep(10000); // 0.01 sec или какая вам там точность нужна.
}
var Go = {
Login: function(){
$("#login").submit(); // но у вас же нет элемента с id=login
}
}
и вообще, зачем это всё?<a href="#" onclick="this.closest('form').submit(); return false;">foo</a>