// mysql files array
$file_bd_items = array();
$bd_files_name = mysqli_query($connect, "SELECT * FROM files");
while($row = mysqli_fetch_array($bd_files_name)) {
$file_bd_items[] = $row['filename'];
}
// server files array
$file_server_items = array();
foreach (scandir(ATTACHMENT_DIRECTORY) as $filename) {
$filepath = ATTACHMENT_DIRECTORY.$filename;
if (!is_file($filepath)) {
continue;
}
$file_server_items[] = $filename;
}
$result = array_values(array_diff($file_bd_items, $file_server_items));
$result_lenght = count($result);
for ($i = 0; $i < $result_lenght; $i++) {
$result_string_filename = $result[$i];
$bd_files_name = mysqli_query($connect, "DELETE FROM files WHERE filename in ('".$result_string_filename."');");
}
find ~/sitename.ru/public_html/mailfile -type f -mtime +15 -print0 | xargs -0 rm -f
<ul class="nav nav-tabs">
<li class="active"><a href="#tab-description" data-toggle="tab"><?php echo $tab_description; ?></a></li>
<?php if ($attribute_groups) { ?>
<li><a href="#tab-specification" data-toggle="tab"><?php echo $tab_attribute; ?></a></li>
<?php } ?>
<?php if ($review_status) { ?>
<li><a href="#tab-review" data-toggle="tab"><?php echo $tab_review; ?></a></li>
<?php } ?>
<?php if ($тут_имя_переменной) { ?>
<li><a href="#tab-название-таба" data-toggle="tab"><?php echo $тут_имя_переменной; ?></a></li>
<?php } ?>
</ul>
!== false
if (mb_stripos(string $read_subject, 'новинки')) return 1;
if (mb_stripos(string $read_subject, 'новинки') !== false) return 1;
mb_stripos как и stripos возвращает значение начиная с "нуля"
foreach ($attachments as $key => $attachment) {
$name = $attachment['name'];
$contents = $attachment['attachment'];
$resp = imap_utf8(trim($name));
if(preg_match("/=\?/", $resp))
$resp = iconv_mime_decode($name, ICONV_MIME_DECODE_CONTINUE_ON_ERROR, "ISO-8859-15");
if(json_encode($resp) == 'null')
$resp = utf8_encode($resp);
file_put_contents($resp, $contents);
}
<p>Lorem ipsum dolor sit amet, consectetur adipisicing elit. Provident, nobis.</p>
<p><b>Lorem</b> ipsum <i>dolor</i> <strong>sit</strong> <b>amet</b>, <em>consectetur adipisicing<em> <b>elit</b>. <em>Provident<em>, nobis.</p>
<p><b>Lorem </b> ipsum <i> dolor </i> <strong> sit</strong> <b> amet</b>, <em> consectetur adipisicing<em> <b>elit </b>. <em> Provident <em>, nobis. </p>
<p><b>Lorem </b> ipsum <i> dolor </i> <strong> sit</strong></p> <p><b> amet</b></p>, <p><em> consectetur adipisicing<em> <b>elit </b>. <em> Provident <em>, nobis. </p>
$(".wicartnum_downbutton").click( function() {
var id = $(this).attr("for"),
value_id = $("#winum_" + id).val();
console.log(id + " " + value_id)
if (value_id == 0) {
$(".for_" + id).prop("disabled",true);
} else {
$(".for_" + id).prop("disabled",false);
}
});
$(document).ready(function(){
var markerPosRew1 = $('#rew-1').offset().top;
var markerPosRew3 = $('#rew-3').offset().top;
if ( markerPosRew1 > 400 || markerPosRew1 < -300 && markerPosRew3 > 400 || markerPosRew3 < -300) {
$(window).scroll(function(){
$(".mbBalloonOverlay").fadeOut(500), $(".mbBalloon").fadeOut(500)
$(".mbBalloonOverlay").fadeOut(500), $(".mbBalloon").fadeOut(500)
})
}
})