I have a php script that show a time like: 9.08374786377E-5, but I need a simple floating value like time, like: 0.00009083747 ..... thats why I just print it with float:
<?php function microtime_float() { list($usec, $sec) = explode(" ", microtime()); return ((float)$usec + (float)$sec); } $time_start = microtime_float(); $time_end = microtime_float(); $time = $time_end - $time_start; printf('%.16f', $time); ?>
It shows the result beautifully, but I need to set this print value in a new variable. How can i do this? I need to set this print value in the new variable $ var;
$var = printf('%.16f', $time);
// We all know that it does not work, but how to install?
source share