$string = 'ips|127.0.0.1||port|12871||query|12881|';
[, $ip, , , $port, , , $query] = explode('|', $string);
var_dump($ip);
var_dump($port);
var_dump($query);
wv = (WebView) findViewById(R.id.webview);
WebSettings ws = wv.getSettings();
ws.setJavaScriptEnabled(true);
ws.setAllowFileAccess(true);
if (Build.VERSION.SDK_INT>=Build.VERSION_CODES.ECLAIR) {
try {
Log.d(TAG, "Enabling HTML5-Features");
Method m1 = WebSettings.class.getMethod("setDomStorageEnabled", new Class[]{Boolean.TYPE});
m1.invoke(ws, Boolean.TRUE);
Method m2 = WebSettings.class.getMethod("setDatabaseEnabled", new Class[]{Boolean.TYPE});
m2.invoke(ws, Boolean.TRUE);
Method m3 = WebSettings.class.getMethod("setDatabasePath", new Class[]{String.class});
m3.invoke(ws, "/data/data/" + getPackageName() + "/databases/");
Method m4 = WebSettings.class.getMethod("setAppCacheMaxSize", new Class[]{Long.TYPE});
m4.invoke(ws, 1024*1024*8);
Method m5 = WebSettings.class.getMethod("setAppCachePath", new Class[]{String.class});
m5.invoke(ws, "/data/data/" + getPackageName() + "/cache/");
Method m6 = WebSettings.class.getMethod("setAppCacheEnabled", new Class[]{Boolean.TYPE});
m6.invoke(ws, Boolean.TRUE);
Log.d(TAG, "Enabled HTML5-Features");
}
catch (NoSuchMethodException e) {
Log.e(TAG, "Reflection fail", e);
}
catch (InvocationTargetException e) {
Log.e(TAG, "Reflection fail", e);
}
catch (IllegalAccessException e) {
Log.e(TAG, "Reflection fail", e);
}
}
Sends – The call to Amazon SES was successful and Amazon SES will attempt to deliver the email.
Rejects – Amazon SES accepted the email, determined that it contained a virus, and rejected it. Amazon SES didn't attempt to deliver the email to the recipient's mail server.
Bounces – The recipient's mail server permanently rejected the email. This event corresponds to hard bounces. Soft bounces are only included when Amazon SES fails to deliver the email after retrying for a period of time.
Complaints – The email was successfully delivered to the recipient. The recipient marked the email as spam.
Deliveries – Amazon SES successfully delivered the email to the recipient's mail server.
Opens – The recipient received the message and opened it in his or her email client.
Clicks – The recipient clicked one or more links contained in the email.
Rendering Failures – The email was not sent because of a template rendering issue. This event type only occurs when you send email using the SendTemplatedEmail or SendBulkTemplatedEmail API operations. This event type can occur when template data is missing, or when there is a mismatch between template parameters and data.
echo "<strong>Фотографии успешно загружены!</strong>";
<?php
$list = [
'ЦАО',
'САО',
'СВАО',
'СЗАО',
'ЗАО',
'ВАО',
'ЮАО',
'ЮЗАО',
'ЮВАО',
'ТиНАО',
'ЗелАО',
];
?>
<select name='district' class='custom-select'>
<?php foreach ($list as $item): ?>
<option value='<?= $item ?>' <?= $item === $row[0]['district'] ? 'selected' : '' ?>>
<?= $item ?>
</option>
<?php endforeach; ?>
</select>
$array = [
'03.2001' => [],
'01.2000' => [],
'01.2005' => [],
'05.2020' => [],
'01.2020' => [],
'30.1998' => [],
'03.2020' => [],
'09.2020' => [],
'04.1998' => [],
'11.2005' => [],
];
uksort($array, function(string $a, string $b): int {
return date_create_from_format('m.Y', $a) <=> date_create_from_format('m.Y', $b);
});
function get_footer()
{
global $link;
$sql = "SELECT * FROM footer WHERE id in (1, 2, 3)";
$result = mysqli_query($link, $sql);
$posts = array();
while ($row = $result->fetch_assoc()) {
$postId = $row['id'];
$posts[$postId] = $row;
}
return $posts;
}
<div class="col-xl-6">
<img src="img/logo.svg" alt="logo" class="logo_footer">
<p><?php echo $posts[1]['description'] ?></p>
</div>
<div class="col-xl-3">
<h5><?php echo $posts[2]['title'] ?></h5>
<p><?php echo $posts[2]['description'] ?></p>
</div>
<div class="col-xl-3">
<h5><?php echo $posts[3]['title'] ?></h5>
<p><?php echo $post[3]['description'] ?></p>
</div>
$json = '[{"id":"352","name":"Сырники из тофу","category":"Завтрак","time":"10:00"},{"id":"355","name":"Овсяная каша","category":"Завтрак","time":"10:00"},{"id":"350","name":"Кефир","category":"Завтрак","time":"10:00"},{"id":"356","name":"Морковный фреш","category":"Завтрак","time":"10:00"},{"id":"359","name":"Салат из помидоров","category":"Обед","time":"14:00"},{"id":"360","name":"Куриный суп с лапшой","category":"Обед","time":"14:00"},{"id":"363","name":"Котлеты из курицы с салатом","category":"Обед","time":"14:00"},{"id":"365","name":"Салат из Десяти фруктов","category":"Обед","time":"14:00"},{"id":"366","name":"Морс Лесные ягоды","category":"Обед","time":"14:00"},{"id":"358","name":"Салат с индейкой","category":"Ужин","time":"20:00"},{"id":"362","name":"Куриная грудка с салатом","category":"Ужин","time":"20:00"},{"id":"364","name":"Тонкий яблочный пирог","category":"Ужин","time":"20:00"},{"id":"367","name":"Морс клюквенный","category":"Ужин","time":"20:00"}]';
$jsonAsArray = json_decode($json, true);
$breakfast = [];
$lunch = [];
$dinner = [];
foreach ($jsonAsArray as $item) {
switch ($item['category']) {
case 'Завтрак':
$breakfast[] = $item;
break;
case 'Обед':
$lunch[] = $item;
break;
case 'Ужин':
$dinner[] = $item;
break;
}
}
print_r($breakfast);
print_r($lunch);
print_r($dinner);
function handler(array $input): array
{
$output = $input;
$idsForDelete = [];
foreach ($input as $i => $item) {
$code = $item['CODE'];
$number = $item['NUMBER'];
if ($code !== 300) {
continue;
}
$key = $number . '-' . $code;
if (isset($idsForDelete[$key])) {
$idsForDelete[$key][] = $i;
} else {
$idsForDelete[$key] = [];
}
}
foreach ($idsForDelete as $ids) {
foreach ($ids as $i => $id) {
unset($output[$id]);
}
}
$arrayWith200 = [];
$arrayWith300 = [];
foreach ($output as $i => $item) {
$code = $item['CODE'];
$number = $item['NUMBER'];
if ($code === 200) {
$arrayWith200[$i] = $number;
}
if ($code === 300) {
$arrayWith300[$i] = $number;
}
}
foreach ($arrayWith300 as $i => $number) {
$key = array_search($number, $arrayWith200);
if ($key === false) {
continue;
}
unset($output[$i]);
unset($output[$key]);
}
return $output;
}
print_r(handler($arr));
Array
(
[6] => Array
(
[ID] => 7
[CODE] => 300
[NUMBER] => 10003
[DATE] => 2020-03-01T10:00:00
)
)
$this->addPost($postinfo, $url, $post)
$image = new Imagick();
$image->newImage(800, 75, new ImagickPixel('transparent'));
$draw = new ImagickDraw();
$draw->setFillColor('#000'); // цвет текста
$draw->setFont('path/to/font/Atial.ttf'); // путь до файла со шрифтом
$draw->setFontSize(30); // размер шрифта
$image->annotateImage($draw, 0, 0, 0, 'Текст Текст');
$image->setImageFormat('png');