или стоит выучить ООП и только потом посмотреть данный плейлист?
//значение data в базе данных 1566668242
// если значение data в базе 2019-09-02 10:18:00 - strtotime($result['data'])
$sql("SELECT id,avatar,login,rey,message,komy,data FROM `messages2`WHERE `komy`='$a'");
$row = $mysqli->query($sql);
setlocale(LC_ALL, 'ru_RU.UTF-8');
while($result = $row->fetch_assoc()){
echo strftime('%a %e %B %G %H:%M:%S', $result['data']) . '<br>';
}
$filesize = 1;
$fio = 'Василий Евграфович Защёлкин';
if ($filesize == 1) { // проверка на общий размер всех файлов. Многие почтовые сервисы не принимают вложения больше 10 МБ
if(mail($to, $subject, $message, $headers)){
// echo $_POST['fio'].', Ваше сообщение получено, спасибо!';
?>
<script type="text/javascript">
var message = "<?= $fio ?>" + ', Ваше сообщение получено, спасибо!';
alert(message)
</script>
<?php
}
else{
?>
<script type="text/javascript">
var message = "<?= $fio ?>" + ', Ваше сообщение НЕ отправлено, обратитесь к администратору!';
alert(message)
</script>
<?php
}
} else {
//echo 'Извините, письмо не отправлено. Размер всех файлов превышает 10 МБ.';
?>
<script type="text/javascript">
var message = 'Извините, письмо не отправлено. Размер всех файлов превышает 10 МБ.';
alert(message)
</script>
<?php
}
?>
if($filesize < 1024 * 1024 * 10){
// code
}
if ( !this.checkValidity() ){
alert('Пожалуйста, заполните обязательные поля.');
}
else {
}
enctype="multipart/form-data"
используйте тогда, когда собираетесь отправлять файлы.success: function (data) {
window.location.href = "../спасибо-за-заказ.htm";
},
if ( !this.checkValidity() ){
alert('Пожалуйста, заполните обязательные поля.');
}
$(document).ready(function() {
// Добавляем маску для поля с номера телефона
$('.phonemasked').each(function(){
$(this).mask('+7 (999) 999-99-99');
});
$(".tel-form").on('submit', function(e) {
e.preventDefault();
$.ajax({
type: "POST",
url: "/form/tel_mail.php",
data: $( this ).serialize(),
success: function (data) {
window.location.href = "../спасибо-за-заказ.htm";
},
});
// очищаем поля
$('#form-tel').val('');
});
});
$files = scandir($dir.'/some-dir0');
foreach($files as $fileNames){
if($fileNames == '.' || $fileNames == '..') continue;
if(is_file('some-dir0/' . $fileNames)){
$fileVals[] = $fileNames;
}
}
echo '<br/>';
print_r($fileVals);
$imapPath = '{imap.gmail.com:993/imap/ssl/novalidate-cert}INBOX';
$username = 'login@gmail.com';
$password = 'password';
$inbox = imap_open($imapPath,$username,$password) or die('Cannot connect to Gmail: ' . imap_last_error());
// Тут главное действие, поиск в папке "Входящие"
$emails = imap_search($inbox,'TEXT "yii"'); // найти письма с текстом "yii"
// или
$emails = imap_search($inbox,'FROM "exsample@mail.com"'); // письма с определённым адресом
ALL - return all messages matching the rest of the criteria
ANSWERED - match messages with the \\ANSWERED flag set
BCC "string" - match messages with "string" in the Bcc: field
BEFORE "date" - match messages with Date: before "date"
BODY "string" - match messages with "string" in the body of the message
CC "string" - match messages with "string" in the Cc: field
DELETED - match deleted messages
FLAGGED - match messages with the \\FLAGGED (sometimes referred to as Important or Urgent) flag set
FROM "string" - match messages with "string" in the From: field
KEYWORD "string" - match messages with "string" as a keyword
NEW - match new messages
OLD - match old messages
ON "date" - match messages with Date: matching "date"
RECENT - match messages with the \\RECENT flag set
SEEN - match messages that have been read (the \\SEEN flag is set)
SINCE "date" - match messages with Date: after "date"
SUBJECT "string" - match messages with "string" in the Subject:
TEXT "string" - match messages with text "string"
TO "string" - match messages with "string" in the To:
UNANSWERED - match messages that have not been answered
UNDELETED - match messages that are not deleted
UNFLAGGED - match messages that are not flagged
UNKEYWORD "string" - match messages that do not have the keyword "string"
UNSEEN - match messages which have not been read yet
sudo add-apt-repository ppa:ondrej/php
sudo apt-get update
sudo apt-get install php7.2-imap
sudo service apache2 restart
$imap = imap_open('{imap.gmail.com:993/imap/ssl/novalidate-cert}INBOX', 'login', 'password');
$emails = imap_search($imap, 'ALL');
if($emails){
echo count($emails);
}
imap_close($imap);
$str = "IEEE 802.11a, IEEE 802.11ac, IEEE 802.11b, IEEE 802.11g, IEEE 802.11n";
preg_match_all('#([\d.]+)([a-z]{1,})#', $str, $matches);
array_multisort(array_map('strlen', $matches['2']), $matches['2']);
echo $matches['1']['0'] . implode('/', $matches['2']);
802.11a/b/g/n/ac
Как мне сделать, чтобы регулярка не игнорировала кириллицу?
$html = '<td>
<b>3. Первый тег B</b>
</td>
<td>
<a title="More..." href="/ссылка">
<b>текст Второй тег B</b>
</a>
</td>
<td align=right>
<b>VIP Третий тег B</b>
</td>';
$dom = new DomDocument();
$dom->loadHTML('<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />'.$html);
$finder = new DomXPath($dom);
$elements = $finder->query(".//b");
foreach($elements as $element){
//print_r($element);
echo PHP_EOL . $element->nodeValue;
}
3. Первый тег B
текст Второй тег B
VIP Третий тег B
<?php
<?php
$arResult["ID"] = 5;
$delaydBasketItems = [2,4,3,6,5];
?>
<input type="checkbox" name="test" id="test">
<?php
if ( in_array($arResult["ID"], $delaydBasketItems) || isset($itInDelay) ) {
?>
<script>
$('#test').attr('checked', true);
</script>
<?php } ?>
<?php echo $color ?>
или <?= $color ?>
<?php
$type = 'add';
$color = $type == 'add' ? 'red' : 'white';
?>
<table style="width: 200px; height: 100px;">
<tr style="background:<?= $color ?>">
<td></td>
<td></td>
<td></td>
</tr>
<tr style="background:<?= $color ?>">
<td></td>
<td></td>
<td></td>
</tr>
<tr style="background:<?= $color ?>">
<td></td>
<td></td>
<td></td>
</tr>
<tr style="background:<?= $color ?>">
<td></td>
<td></td>
<td></td>
</tr>
</table>
$upd = mysqli_query($db, "UPDATE golosa SET id=1, var1 = '$row[0]' ");
$upd = mysqli_query($db, "UPDATE `golosa_vote` SET `var1` = '$row[0]' WHERE ` id`=1");
function login($url,$login,$pass){
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $url);
// откуда пришли на эту страницу
curl_setopt($ch, CURLOPT_REFERER, $url);
// cURL будет выводить подробные сообщения о всех производимых действиях
curl_setopt($ch, CURLOPT_VERBOSE, 1);
curl_setopt($ch, CURLOPT_POST, 1);
//curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1);
curl_setopt($ch, CURLOPT_POSTFIELDS,"username=".$login."&password=".$pass);
curl_setopt($ch, CURLOPT_USERAGENT, "Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/49.0.2623.87 Safari/537.36");
curl_setopt($ch, CURLOPT_HEADER, 1);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
//сохранять полученные COOKIE в файл
curl_setopt($ch, CURLOPT_COOKIEJAR, $_SERVER['DOCUMENT_ROOT'].'/parser/cookie.txt');
curl_setopt($ch, CURLOPT_COOKIEFILE, $_SERVER['DOCUMENT_ROOT'].'/parser/cookie.txt');
$result=curl_exec($ch);
//echo $result;
curl_close($ch);
return $result;
}