Non-standard
This feature is non-standard and is not on a standards track. Do not use it on production sites facing the Web: it will not work for every user. There may also be large incompatibilities between implementations and the behavior may change in the future.
This method has been removed from the FileAPI standard. FileReader.readAsArrayBuffer() should be used instead.
$request = $pdo->prepare("SELECT `id`, `name` FROM `fruits` ORDER BY `name`");
$request->execute();
$data = [];
$prevLetter = '';
$subArray = [];
foreach ($row = $request->fetch(PDO::FETCH_ASSOC)) {
$firstLetter = mb_substr($row['name'], 0, 1);
if ($prevLetter != $firstLetter) {
if (count($subArray) > 0)
$data[] = $subArray;
$subArray = [];
$prevLetter = $firstLetter;
}
$subArray[] = $row;
}
if (count($subArray) > 0)
$data[] = $subArray;
function changeIconChat() {
$('.chat').each(function() {
if ($(this).hasClass('gray'))
$(this).removeClass('gray');
else
$(this).addClass('gray');
});
}
setInterval(changeIconChat, 2000);
A p element's end tag may be omitted if the p element is immediately followed by an address, article, aside, blockquote, div, dl, fieldset, footer, form, h1, h2, h3, h4, h5, h6, header, hgroup, hr, main, nav, ol, p, pre, section, table, or ul, element, or if there is no more content in the parent element and the parent element is not an a element.
<input type="text" name="contact[]">
. Тогда в PHP придёт массив значений $_POST['contact'][].<input type="file" name="f[]">
. В обоих случаях обработка стандартная, через массив $_FILES $('#id_элемента_с_карандашом/галочкой').click(function() {
var input = $('#id_инпута');
if (input.prop('disabled')) {
input.prop('disabled', false);
$(this).removeClass('icon-карандаш').addClass('icon-галочка');
} else {
input.prop('disabled', true);
$(this).removeClass('icon-галочка').addClass('icon-карандаш');
}
});