"PHP" / Говнокод #1824 Ссылка на оригинал

0

  1. 1
  2. 2
$time_portions = explode(' ', microtime());
$actual_time = $time_portions[1] . substr($time_portions[0], 1);

microtime(true) было бы слишком просто

Запостил: shitcoder shitcoder, (Updated )

Комментарии (3) RSS

  • microtime(true) есть только начиная с PHP 5.0.
    Вот что выводит PHP 4.4.4
    actual_time = 1252589852.89263600
    microtime() = 0.89274500 1252589852
    microtime(true) = 0.89276000 1252589852
    ------------------------------------------
    Исходный код:
    <?php
    $time_portions = explode(' ', microtime());
    $actual_time = $time_portions[1].substr($time_portions[0], 1);
    echo "actual_time = $actual_time<br>";
    echo "microtime() = ".microtime()."<br>";
    echo "microtime(true) = ".microtime(true)."<br>";
    phpinfo();
    ?>
    Ответить
      • а сложить два числа без субстра религия непозволяет? 🙂
        Ответить

Добавить комментарий

Где здесь C++, guest?!

    А не использовать ли нам bbcode?


    8