$v = mt_rand() / mt_getrandmax();
will do that.
In case you want only one decimal place (as in the examples from the question) just round() the value you get...
$v = round( $v, 1 );
...or calculate a number between 0 and 10 and divide by 10:
$v = mt_rand( 0, 10 ) / 10;