$width = 300;
$height = 500;
$scale = 16/9;
$newWidth = 0;
$newHeight = 0;
if ($width / $height > $scale) {
$newWidth = $width;
$newHeight = round($width / $scale);
} else {
$newHeight = $height;
$newWidth = round($height * $scale);
}
echo($newWidth.'x'.$newHeight);
<?php
$file = json_decode(@file_get_contents('http://site.ru/api/56456456'));
$max = 0;
foreach($file->history as $obj){
if ($obj->stime >= strtotime(date("Y/m/d 00:00:00"))){
// Нужно узнать максимальное s_value при условии if
if ($obj->s_value > $max) {
$max = $obj->s_value;
}
}
}
echo($max);
?>
N = A + 3a
N = B + 4b
N = C + 5c
A = N - 3a
B = N - 4b
C = N - 5c
40A + 45B + 36C =
40(N - 3a) + 45(N - 4b) + 36(N - 5c) =
40N - 120a + 45N - 180b + 36N - 180c =
121N - 120a - 180b - 180c =
N + 120N - 120a - 180b - 180c