I am trying to find the two smallest numbers out of a set of three, and then I want to display them on the screen. In PHP, we usually use echo to display values on the screen. However, with this code snippet, I am only able to get one smallest value instead of both. How can I modify it to display both of the smallest numbers on the web page?
<script type="text/javascript">
var a = 5;
var b = 4;
var c = 6;
var d = Math.min(a,b,c);
</script>
Therefore, the expected output should be "First smallest: 4" and "Second smallest: 5".
I aim to store these first and second lowest values in different variables like var first = 4 and var second = 5, and then display them using PHP code <?php echo $first;?> and <?php echo $second ; ?>.