<?php
function transLit($text){
$alfavit = array('а'=>'a', 'б'=>'b', 'в'=>'v', 'г'=>'g', 'д'=>'d', 'е'=>'ye', 'ё'=>'yo', 'ж'=>'zh', 'з'=>'z', 'и'=>'i', 'к'=>'k', 'л'=>'l','м'=>'m', 'н'=>'n','о'=>'o', 'п'=>'p','р'=>'r', 'с'=>'s', 'т'=>'t', 'у'=>'u','ф'=>'f','х'=>'kh', 'ц'=>'ts', 'ч'=>'ch', 'ш'=>'sh','щ'=>'tch', 'ъ'=>'"', 'ы'=>'y', 'ь'=>'`', 'э'=>'eh', 'ю'=>'yu', 'я'=>'ya');
$text_a = preg_split('//u', $text, -1, PREG_SPLIT_NO_EMPTY);
$text = '';
foreach($text_a as $val) {
$text .= (isset($alfavit[$val])) ? $alfavit[$val] : $val;
}
return $text;
}
$text = "Привет мир! Как дела?";
echo transLit($text);
?>
Пrivyet mir! Кak dyela?
<code lang="php">
<?php
if ($_SERVER["REQUEST_METHOD"] == "POST") {
if (isset($_POST['site'])) {$site = '<b>Сайт:</b> '.$_POST['site'];}
if (isset($_POST['geo'])) {$geo = '<b>Геграфия рекламы:</b> '.$_POST['geo'];}
if (isset($_POST['phone'])) {$phone = '<b>Телефон:</b> '.$_POST['phone'];}
if (isset($_POST['email'])) {$email = '<b>email:</b> '.$_POST['email'];}
if (isset($_POST['formData'])) {$formData = $_POST['formData'];}
$to = "mail@gmail.com";
$sendfrom = "mail@gmail.com";
$headers = "From: " . strip_tags($sendfrom) . "\r\n";
$headers .= "Reply-To: ". strip_tags($sendfrom) . "\r\n";
$headers .= "MIME-Version: 1.0\r\n";
$headers .= "Content-Type: text/html;charset=utf-8 \r\n";
$subject = "$formData";
$message = "$formData
$site
$geo
$email
$phone";
$send = mail ($to, $subject, $message, $headers);
if ($send == 'true')
{
echo '<center>
Спасибо за отправку вашего сообщения!
</center>';
}
else
{
echo '<center>
<b>Ошибка. Сообщение не отправлено!</b>
</center>';
}
} else {
http_response_code(403);
echo "Попробуйте еще раз";
}?>
</code>
<?php
$a = array('0defsdfsdf', 10.5, 5.4, 3.3, 2.2, 0.1);
echo min($a);
Так вот. Если оно приводится к нулю, то чего оно не в результате? Если 0.1 больше 0
date('Y-m-d h:i', $model->published_at);
1486924655 - 2017-02-12 06:37:35
2017-02-12 06:37:00
1486881420
date('Y-m-d h:i:s', $model->published_at);
<br>
уберите в условии if(($userdata['user_hash'] !== $_COOKIE['hash']) or ($userdata['user_id'] !== $_COOKIE['id'])<br> or (($userdata['user_ip'] !== $_SERVER['REMOTE_ADDR']) and ($userdata['user_ip'] !== "0")))
function detect_device() {
var w = window,
d = document,
e = d.documentElement,
g = d.getElementsByTagName('body')[0],
x = w.innerWidth || e.clientWidth || g.clientWidth,
y = w.innerHeight|| e.clientHeight|| g.clientHeight;
var isiPhone = navigator.userAgent.toLowerCase().indexOf("iphone");
var isiPad = navigator.userAgent.toLowerCase().indexOf("ipad");
var isiPod = navigator.userAgent.toLowerCase().indexOf("ipod");
var isiAndroid = navigator.userAgent.toLowerCase().indexOf("android");
if(isiPhone > -1 || isiPad > -1 || isiPod > -1 || isiAndroid > -1 && mobile == false){
window.location='mobile.php?page=login';
}
if(x <= 800 && mobile == false){
window.location='mobile.php?page=index';
}
}
detect_device();
window.onresize = function() {
var w = window,
d = document,
e = d.documentElement,
g = d.getElementsByTagName('body')[0],
x = w.innerWidth || e.clientWidth || g.clientWidth,
y = w.innerHeight|| e.clientHeight|| g.clientHeight;
if(x <= 800 && mobile == false){
window.location='mobile.php?page=index';
}
if(x > 801 && mobile == true){
window.location='index.php?page=index';
}
};