I'm trying to format a value that exits from the rand()
function except that it is not the normal way. I have rand()
:
<?php
$valor = rand(3000,7000);
echo number_format($valor, 2);
?>
Output: 5000.00
I need the output to be 50.00 and not 5000.00.
I had a code that rand()
would go with the "." (dot), being more or less so
<?php
rand(30.00, 70.00)
?>
But it seemed that he made the draw with the first 2 values, from 30 to 70 and also need to get the cents, that is, it could be a draw that goes out for example 41.32