I'm currently working on a kind of PHP Quiz about mathematical calculations.  We show a mathematical equation, and user need to input his answer.Currently, this is what I have written:echo '<div class=table-title>Super Quizz</div>';echo '<div class=row text-center quizz>';function addition($x, $y) { return $x + $y; }function substraction($x, $y) { return $x - $y; }function multiplication($x, $y) { return $x * $y; }function division($x, $y) { return $x / $y; }do {    $firstNumber = rand(1, 10);    $secondNumber = rand(1, 10);    $operatorsCharacteres = array('+', '-', 'x', '/');    $operatorsLetter = array('addition', 'substraction', 'multiplication',             'division');    $operande = array_rand($operatorsLetter);    $result = call_user_func_array($operatorsLetter[$operande],     array($firstNumber, $secondNumber));}while($result < 0);echo $firstNumber.' '.$operatorsCharacteres[$operande].' '.$secondNumber.' = <input type=text name=answer maxlength=3 class=input-quizz >';echo '<input type=hidden value='.$result.'>';echo ' </div>';echo '<div class=table-title><a href=# type=submit>I valid !</a></div>';echo 'Result : '.$result;If something is wrong, or not optimised, please, tell me, and teach me.
How much is 2 + 2?
php;random;form;quiz
NamingThe naming of the arrays related to the operators is not so great:In $operatorsLetter you have the names of functions that do some operation. $operatorFunctionNames or even $operatorFunctions would be a better name.In $operatorsCharacteres you have the symbols of operations. These are normally not called characters. So $operatorSymbols would be a better name.In $operande you have the key of a random operator. That's not an operand. In the operation 3 + 9, the operands are 3 and 9, but in your code it's addition. So $operatorIndex would be a better name.With these renames, the code is slightly easier to understand:$operatorSymbols = array('+', '-', 'x', '/');$operatorFunctions = array('addition', 'substraction', 'multiplication', 'division');$operatorIndex = array_rand($operatorFunctions);$operatorSymbol = $operatorSymbols[$operatorIndex];$operatorFunction = $operatorFunctions[$operatorIndex];$result = call_user_func_array($operatorFunction, array($firstNumber, $secondNumber));I also introduced the helper variables $operatorSymbol and $operatorFunction,to shorten the lines later in the code that use them.Printing in PHPAn easier way to print in PHP is to simply move text outside of <?php ... ?> blocks.For example these lines at the beginning of your script are a bit tedious to write using echo statements:echo '<div class=table-title>Super Quizz</div>';echo '<div class=row text-center quizz>';Instead, you could change your script to put the beginning <?php after those lines, like this:<div class=table-title>Super Quizz</div><div class=row text-center quizz><?phpfunction addition($x, $y) { return $x + $y; }function substraction($x, $y) { return $x - $y; }// ...I would do similarly near the end of the file too, like this:// ...echo $firstNumber.' '.$operatorSymbol.' '.$secondNumber;?> = <input type=text name=answer maxlength=3 class=input-quizz >    <input type=hidden value=<?php echo $result ?>></div><div class=table-title><a href=# type=submit>I valid !</a></div>Result : <?php echo $result ?>