$numb1 = (float)$_POST['num1'];
$numb2 = (float)$_POST['num2'];
$numb1 = +$_POST['num1'];
$numb2 = +$_POST['num2'];
<?php
error_reporting(E_ALL);
# error_reporting(E_ALL & ~E_NOTICE);
ini_set('display_errors', 'on');
setlocale(LC_ALL, 'ru_RU.UTF-8');
#-------------------------------------------------
$operations = ['+', '-', '*', '/'];
$numb1 = 0;
$numb2 = 0;
If (!empty($_POST['num1']) && !empty($_POST['num2'])) {
if (in_array($_POST['oper'], $operations)) {
$numb1 = +$_POST['num1'];
$numb2 = +$_POST['num2'];
switch ($_POST['oper']) {
case '+':
$res = $numb1 + $numb2;
break;
case '-':
$res = $numb1 - $numb2;
break;
case '*':
$res = $numb1 * $numb2;
break;
case '/':
$res = $numb1 / $numb2;
break;
default:
echo "НЕДОПУСТИМОЕ ДЕЙСТВИЕ";
}
}else{
$res = "Ошибка операции";
}
}
?>
<form action='calc.php' method="post">
<label>Число 1:</label>
<br />
<input name='num1' type='number' value="<?=$numb1 ?>" />
<br />
<label>Оператор: </label>
<br />
<select name="oper">
<?php foreach ($operations as $oper): ?>
<option value="<?= $oper;?>"><?=$oper;?></option>
<?php endforeach;?>
</select>
<br />
<label>Число 2: </label>
<br />
<input name='num2' type='number' value="<?=$numb2 ?>" />
<br />
<?php if (isset($res)): ?>
<p> Результат: <?=$res?></p>
<?php endif;?>
<br />
<input type='submit' value='Считать'>
</form>
$agentId = "2323";
$orderId = "777";
$agentTime = date("H:i:s d.m.y") ;
$amount = "25";
$phone = "79090000111";
$sign = md5("$agentId#$orderId#$agentTime#$amount#$phone");
$agentId = "2323";
$orderId = "777";
$agentTime = date("H:i:s d.m.y") ;
$amount = "25";
$phone = "79090000111";
$token = md5("<token>");
$sign = md5("$agentId#$orderId#$agentTime#$amount#$phone#$token");
<?php
foreach ($cont_url2 as $el2) {
$pq2 = pq($el2);
$text2 = $pq2->find('.messageText');
$text2->remove('[noindex]');
$text2->remove('.internalLink');
$text2->remove('.mceSmilie');
$text2->remove('.messageTextEndMarker');
$text2->remove('aside');
if(!empty($text2)) {
$post_prev = R::dispense('postprev');
$post_prev->text = $text2;
R::store($post_prev);
}
}