Answer the question
In order to leave comments, you need to log in
How can I prevent the Referer from being sent when playing an audio file via the HTML Audio tag?
There is a page on which you need to play the specified file through the audio tag (or its Audio DOM object). It is necessary to make sure that when downloading a file from the server, Referer is not sent on any browsers. How to be? Do not offer Web Audio API, because it is raw and not yet usable. Maybe you can somehow pull the file through XHR and play it through the data pseudo-protocol? Tell me something.
Answer the question
In order to leave comments, you need to log in
All wrong.
function calculate($operandOne, $operandTwo, $operator)
{
if (!is_numeric($operandOne) || !is_numeric($operandTwo)) {
return null;
}
switch ($operator) {
case '+':
return $operandOne + $operandTwo;
case '-':
return $operandOne - $operandTwo;
case '/':
if ($operandTwo <= 0) {
return null;
}
return $operandOne / $operandTwo;
case '*':
return $operandOne * $operandTwo;
default:
echo 'Допускаются только операторы + - / *';
return null;
}
}
$operandOne = 6;
$operandTwo = 4;
echo calculate($operandOne, $operandTwo, '+');
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question