How can the script be modified to handle the calculation of the mathematical expression correctly?

The issue with the current script is that it is not evaluating the mathematical expression correctly due to the concatenation of the input values as strings. To solve this issue, we need to use the eval() function in PHP to evaluate the mathematical expression as a proper calculation.

<?php
$input = "1+2*3";
$result = eval('return ' . $input . ';');
echo "Result: " . $result;
?>