$link = new PDO("mysql:host=localhost;dbname=DB;charset=UTF8");
$imagejpeg = imagecreatefromjpeg(__DIR__ . '/test.jpg');
$imagejpeg = imagecropauto($imagejpeg, IMG_CROP_THRESHOLD, 1, 16777215);
header('Content-Type: image/jpeg');
echo imagejpeg($imagejpeg);
$xml = simplexml_load_file($xmlfile);
// translit
function rus2lat4alias($text) {
$text = mb_strtolower(trim($text));
$text = preg_replace("/([0-9])х([0-9])/", "$1-$2", $text); // Ха русская
$text = preg_replace("/([0-9])x([0-9])/", "$1-$2", $text); // Икс латинская
$ru = explode(" ", "а б в г д е ё ж з и й к л м н о п р с т у ф х ц ч ш щ ъ ы ь э ю я");
$lat = explode(" ", "a b v g d e e zh z i j k l m n o p r s t u f h c ch sh sch - y - e ju ja");
$text = str_replace($ru, $lat, $text);
unset($ru, $lat);
$text = preg_replace("/[^a-zA-Z0-9\-]/", "-", $text);
$text = preg_replace("/[-]{2,}/", "-", $text);
$text = trim($text, '-');
return $text;
}
$text = 'Некий текст - пуcть будет с размером 300х400 :)';
$alias = rus2lat4alias($text);
<script>
$(document).on('click', '#close_vid', function() {
jQuery("iframe").each(function() {
jQuery(this)[0].contentWindow.postMessage('{"event":"command","func":"pauseVideo","args":""}', '*')
});
});
</script>
<script>
$(document).on('click', '#play_video', function() {
jQuery("iframe").each(function() {
jQuery(this)[0].contentWindow.postMessage('{"event":"command","func":"playVideo","args":""}', '*')
});
});
</script>
API настроить нереально
// https://iresurs.com
$opening_hours = '11:00 - 01:00';
$opening_start = trim(explode('-', $opening_hours)[0]);
$opening_start_hours = explode(':', $opening_start)[0];
$opening_start_minutes = explode(':', $opening_start)[1];
$opening_start_today = $opening_start_hours * 60 + $opening_start_minutes;
// echo $opening_start_today.'<br>';
$opening_end = trim(explode('-', $opening_hours)[1]);
$opening_end_hours = explode(':', $opening_end)[0];
$opening_end_minutes = explode(':', $opening_end)[1];
$opening_end_today = $opening_end_hours * 60 + $opening_end_minutes;
if ($opening_end_today <= $opening_start_today) $opening_end_today = 24 * 60 + $opening_end_today;
// echo $opening_end_today.'<br>';
$config = JFactory::getConfig(); // это для CMS Joomla
$zone = $config->get('offset'); // часовой пояс (зона)
// echo $zone.'<br>';
$now = new DateTime('now', new DateTimeZone($zone));
$now_hours = $now->format('H');
$now_minutes = $now->format('i');
$now_today = $now_hours * 60 + $now_minutes;
// echo $now_today.'<br>';
if ($now_today > $opening_start_today && $now_today < $opening_end_today) {
echo $output;
} else {
echo '<div class="cart-view"><h1>Время приёма заказов: '.$opening_hours.'</h1><p>Пожалуйста, зайдите позже.</p></div>';
}