Потеря этих данных может принести привести, например, к удалению видео с ютуба или ВК и тд
/notifications?by=company&data=1&sort=date&desc=1&limit=10
{
"collection":[
{"id": 333, "data":{"content":{"title": null, "preview": null,…},
{"id": 332, "data":{"content":{"title": null, "preview": null,…},
{"id": 331, "data":{"content":{"title": null, "preview": null,…},
{"id": 330, "data":{"content":{"title": null, "preview": null,…}
],
"has_more": true
}
notifications?by=company&data=1&sort=date&desc=0&limit=10
{
"collection":[
{"id": 169, "data":{"content":{"title": null, "preview": null,…},
{"id": 170, "data":{"content":{"title": null, "preview": null,…},
{"id": 171, "data":{"content":{"title": null, "preview": null,…},
{"id": 172, "data":{"content":{"title": null, "preview": null,…},
{"id": 173, "data":{"content":{"title": null, "preview": null,…},
{"id": 174, "data":{"content":{"title": null, "preview": null,…},
{"id": 175, "data":{"content":{"title": null, "preview": null,…},
{"id": 176, "data":{"content":{"title": null, "preview": null,…},
{"id": 177, "data":{"content":{"title": null, "preview": null,…},
{"id": 178, "data":{"content":{"title": null, "preview": null,…}
],
"has_more": true
}
<html>
<head>
<title> Шеснадцатиричные числа </title>
<style>
.st {
outline: 2px solid #000;
}
</style>
<!-- Реализация класса -->
<?php class Construction
{
protected $OneNumber;
protected $TwoNumber;
protected $ZnakNumber;
public function __construct($One, $Two, $Znak)
{
$this->OneNumber = $One;
$this->TwoNumber = $Two;
$this->ZnakNumber = $Znak;
}
public function dec($h)
{
$s = [
1 => 1,
2 => 2,
3 => 3,
4 => 4,
5 => 5,
6 => 6,
7 => 7,
8 => 8,
9 => 9,
'a' => 10,
'b' => 11,
'c' => 12,
'd' => 13,
'e' => 14,
'f' => 15,
16 => 16,
];
return $h ? 16 * $this->dec(substr($h, 0, -1)) + $s[ substr($h, -1) ] : 0;
}
public function hex($d)
{
$s = [
1 => 1,
2 => 2,
3 => 3,
4 => 4,
5 => 5,
6 => 6,
7 => 7,
8 => 8,
9 => 9,
10 => 'a',
11 => 'b',
12 => 'c',
13 => 'd',
14 => 'e',
15 => 'f',
16 => 16,
];
return $d ? $this->hex(floor($d / 16)) . $s[ $d % 16 ] : '';
}
public function itog($OneNumber, $TwoNumber, $Znak)
{
//атрибуты
$One = $this->dec($OneNumber);
$Two = $this->dec($TwoNumber);
switch ($Znak) {
case '-':
$result = $One - $Two;
break;
case '+':
$result = $One + $Two;
break;
};
$finalResult = $this->hex($result ?? 0);
return $finalResult;
}
//Метод вывода информации в браузер
public function printResult()
{
$result = 0;
$OneNumber = $this->OneNumber;
$TwoNumber = $this->TwoNumber;
$ZnakNumber = $this->ZnakNumber;
if ($ZnakNumber == '-') {
$result = $OneNumber - $TwoNumber;
}
if ($ZnakNumber == '+') {
$result = $OneNumber + $TwoNumber;
}
echo $result;
}
}
// Реализация класса наследника
class NewConstruction extends Construction
{
}
?>
</head>
<body bgcolor="gray">
<form method="get" action="#" align="center" style="margin-top:10%;">
<input type="text" class="st" placeholder="Введите число" name="onenumber">
<select size="1" name="znak" class="st">
<option>+</option>
<option>-</option>
</select>
<input type="text" class="st" placeholder="Введите число" name="twonumber">
=
<br>
Первый вариант вывода строки(Результат):
<?php
$zn = $_REQUEST['znak'] ?? 1;
$one = $_REQUEST['onenumber'] ?? 0;
$two = $_REQUEST['twonumber'] ?? 1;
$Constr = new Construction($one, $two, $zn);
$Constr->itog($one, $two, $zn);
?>
<br>
Второй вариант вывода строки(Результат):
<?php
$Constr = new Construction($one, $two, $zn);
$Constr->printResult();
?>
<br>
Третий вариант вывода(Результат):
<?php
$ConstrNew = new Construction($one, $two, $zn);
$ConstrNew->itog($one, $two, $zn);
?>
<p><input type="submit" value="Отправить"></p>
</form>
</body>
</html>