strange sprintf

Discussion in 'Programming' started by swan999, Sep 7, 2012.

  1. #1
    Hello!

    This is a small problem. if anyone knows, please help.

    Here is the code:

    
    
    $start_time = microtime(true);
    
    $data = '';
    for ($i = 0; $i < 1000; $i++)
    {
        $data = $data . $i;
    }
    
    echo sprintf('%01.4f', microtime(true) – $start_time); // this line generate error
    
    
    PHP:
    And I get the following error: Parse error: syntax error, unexpected T_STRING in ... '' here
    echo sprintf('%01.4f', microtime(true) – $start_time);

    Thank you! :eek:
     
    swan999, Sep 7, 2012 IP
  2. neroux

    neroux Active Member

    Messages:
    566
    Likes Received:
    8
    Best Answers:
    0
    Trophy Points:
    60
    #2
    neroux, Sep 8, 2012 IP