$s = floatval("-2.1123423897498E+28");
echo number_format($s); //-21,123,423,897,497,998,933,557,772,288
<?php
$minutes = 300;
$hours = floor($minutes / 60); // Считаем количество полных часов
$minutes = $minutes - ($hours * 60); // Считаем количество оставшихся минут
$hide = $hours == 0?" hide":"";
echo "<div class='hours$hide'>"$hours.' ч.</div><div class="minutes"> '.$minutes.' мин.</div> ';
?>
.hide{
display:none;
}
$postID = $_POST['label'];
if ($proverka == 'da') {
$db = new Mysqli("localhost", "neskazhu", "neskazhu", "neskazhu");
$result = mysql_query ("SELECT * FROM mytable WHERE meta_key='subject_name' AND meta_value='$postID'");
$sql=mysql_fetch_assoc($result);
$buff = 0;
while ($row = mysql_fetch_assoc($result)) {
$buf = $row['post_id'];
update_post_meta($buf, 'payment', 'Да');
}
$postID = $buf; //вот тут хочу вытащить последний элемент из цикла, а он не выходит... (мне без разницы, на самом деле, последний или первый достать элемент, мне он нужен просто)
}
var str ="01 01:00 02:00 03:00 04:00 05:00 \n02 01:00 02:00 03:00 04:00 05:00\n03 01:00 02:00 03:00 04:00 05:00\n04 01:00 02:00 03:00 04:00 05:00 \n05 01:00 02:00 03:00 04:00 05:00";
if(str.match(/^(\d{1,2}\s+(\d{1,2}\:\d{1,2}\s+){4}\d{1,2}\:\d{1,2}(\s?)+)+$/m)[0] != str)
console.log("проверка прошла неудачно");
else
console.log("проверка прошла удачно")
<div class="home-fotka" style="background-image:url(fotke/F22B2D63-1B3D-46FA-B32C-CA0DBF6DDEF2.gif); font-family: Verdana, Geneva, sans-serif;">
на<div class="home-fotka" style="background-image:url(fotke/F22B2D63-1B3D-46FA-B32C-CA0DBF6DDEF2.gif);font-family: Verdana, Geneva, sans-serif;opacity: .5;">
{\rtf1\ansi\ansicpg1251\deff0\nouicompat\deflang1049{\fonttbl{\f0\fnil\fcharset204 Calibri;}{\f1\fnil\fcharset0 Calibri;}{\f2\fnil\fcharset1 Segoe UI Symbol;}{\f3\fnil Calibri;}{\f4\fnil\fcharset1 Cambria Math;}}
{\*\generator Riched20 10.0.14393}{\*\mmathPr\mmathFont4\mwrapIndent1440 }\viewkind4\uc1
\pard\sa200\sl276\slmult1\f0\fs22
<?PHP
$s = 'Hello, world!\ntest!\n\n\n Вася Пупкин тут.';
for($i = 0; $i < strlen($s);$i++)
if($s[$i] == '\\' && $i+1 < strlen($s) && $s[$i+1] == "n"){
$i++;
echo "\par";
}else
echo "\\'".getANSICodeHex($s[$i]);
function getANSICodeHex($sym) {
$arr = ["","","","","","","","","","","","","+","","","0",">","<","","","¶","§","-","¦","^","v",">","<","L","-","^","Ў","3","!","\"","#","$","%","&","'","(",")","*","+",",","-",".","/","0","1","2","3","4","5","6","7","8","9",":",";","<","=",">","?","@","A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z","[","\\","]","^","_","`","a","b","c","d","e","f","g","h","i","j","k","l","m","n","o","p","q","r","s","t","u","v","w","x","y","z","{","|","}","~","¦","Ђ","Ѓ","‚","ѓ","„","…","†","‡","€","‰","Љ","‹","Њ","Ќ","Ћ","Џ","ђ","‘","’","“","”","•","–","—","1","™","љ","›","њ","ќ","ћ","џ"," ","Ў","ў","Ј","¤","Ґ","¦","§","Ё","©","Є","«","¬","","®","Ї","°","±","І","і","ґ","µ","¶","·","ё","№","є","»","ј","Ѕ","ѕ","ї","А","Б","В","Г","Д","Е","Ж","З","И","Й","К","Л","М","Н","О","П","Р","С","Т","У","Ф","Х","Ц","Ч","Ш","Щ","Ъ","Ы","Ь","Э","Ю","Я","а","б","в","г","д","е","ж","з","и","й","к","л","м","н","о","п","р","с","т","у","ф","х","ц","ч","ш","щ","ъ","ы","ь","э","ю","я"];
for($i = 0; $i < count($arr);$i++)
if($arr[$i] == $sym)
return dechex($i);
return 0;
}
?>
\f1\lang9
}
<?PHP
header("Content-Type: application/msword;");
header("Content-Disposition: attachment; filename=file.rtf");
header("Pragma: no-cache");
header("Expires: 0");
?>
<?php
define("VICHIT", 1);
define("delen", 2);
define ("ymnozh", 3);
define("slozhe",4);
function mathOperation($arg1, $arg2,$operation)
{
switch ($operation)
{
case VICHIT:
return bar($arg1, $arg2);
break;
case delen:
return $kamera($arg1, $arg2);
break;
case ymnozh:
return $z($arg1,$arg2);
break;
case slozhe;
return $metla($arg,$arg2);
break;
}
}
echo mathOperation(3,5,1); // вот тут проблема
function bar($x,$y)
{
return ($x-$y);
}
$pivo=bar(12,89);
//echo "$pivo<br>";
function foto($x,$y)
{
return ($x%$y);
}
$kamera=foto(4,5);
//echo "$kamera<br>";
function carga($x, $y)
{
return ($x+$y);
}
$metla=carga(3,15);
//echo "$metla <br>";
function glaz($h, $r)
{
return ($h * $r);
}
$z=glaz(45,55);
//echo "$z<br>";
?>
<?PHP
$offset = isset($_GET["offset"])?$_GET["offset"]:0;
$limit = isset($_GET["limit"])?$_GET["limit"]:19;
$movie = mysqli_query($connection, "SELECT * FROM `video` ORDER BY 'id' LIMIT ".$limit." OFFSET ".$offset);
$mov = array();
while($row = mysqli_fetch_array($movie))
array_push($mov,$row);
foreach ($mov as $m): ?>
<li>
<div class="desc">
<a href="#">
<img src="media/img/<?php echo $m['img'].'.jpg' ?>" width="240" height="160"/>
<span class="vieo_time"></span></a>
</div>
<div class="video_name">
<a href="#" title="<?php echo $m['title']; ?>"><?php echo $m['title']; ?></a></div>
<span class="views">Просмотров: <?php echo $m['views']; ?></span>
</li>
<?php endforeach; ?>
<div id="page">
<ul>
<?php
$res = mysqli_query($connection, "SELECT CEILING(COUNT(id)/".$limit.") FROM video");
$len = mysqli_fetch_row($res)[0];
for($i = 0; $i < $len; $i++)
echo "<li><a href='?limit=$limit&offset=".($limit*$i)."'>". ($i + 1)." </a></li>";
?>
</ul>
</div>
$("p").each(function(i, el) {
if (el.children.length == 1 && el.children[0].nodeName == "IMG") {
$(el).after(el.children[0]);
$(el).remove();
}
});
include("./SxGeo.php");
$SxGeo = new SxGeo('SxGeoCity.dat');
if($SxGeo->get(get_ip())["city"]["name_ru"] == "Москва"){
//Что-то делаем
}
else{
//Делаем что-то другое
}
function get_ip()
{
if (!empty($_SERVER['HTTP_CLIENT_IP']))
{
$ip=$_SERVER['HTTP_CLIENT_IP'];
}
elseif (!empty($_SERVER['HTTP_X_FORWARDED_FOR']))
{
$ip=$_SERVER['HTTP_X_FORWARDED_FOR'];
}
else
{
$ip=$_SERVER['REMOTE_ADDR'];
}
return $ip;
}