FUDforum
Fast Uncompromising Discussions. FUDforum will get your users talking.

Home » Imported messages » comp.lang.php » Counting the duration in PHP
Show: Today's Messages :: Polls :: Message Navigator
Return to the default flat view Create a new topic Submit Reply
Re: Counting the duration in PHP [message #170701 is a reply to message #170698] Mon, 15 November 2010 13:14 Go to previous messageGo to previous message
Jerry Stuckle is currently offline  Jerry Stuckle
Messages: 2598
Registered: September 2010
Karma:
Senior Member
On 11/15/2010 7:33 AM, venky_lb wrote:
> Hi all,
> I have a csv file from where i read the datas and show them on my
> UI, the data would be something like "66:23:12" (HH:MM:SS).
> The task is now to increment the duration manually and show them in
> the UI until the csv is been updated.
>
> $time_str_parts = explode(':', "66:23:12"); //duration from the csv
> file
> $chng_hour = $time_str_parts[0];
> $chng_min = $time_str_parts[1];
> $chng_secs = $time_str_parts[2] + 1;
>
> if ($time_str_parts[2]>= 58) {
> $chng_hour = $time_str_parts[0] + 1;
>
> if ($time_str_parts[0]>= 58) {
> $chng_min = $time_str_parts[1] + 1;
> }
> }
> $cL = $chng_hour . ':' . $chng_min . ':' . $chng_secs;
> echo $cL;
>
> Help,suggestions and queries appreciated.
>
> Thanks

You can't do this reliably in PHP. PHP is server side, and you can't
guarantee when data will be displayed by the browser. For instance, it
may be displayed as you send it - but more likely it will be buffered by
php, the web server, the server's OS and/or the browser. You can
control the php buffering with flush(), but you can't control the rest.

If you need something like this, you'll have to go to a client-side
language such as javascript, flash or the like.

--
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
jstucklex(at)attglobal(dot)net
==================
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: Stats comp.lang.php (last 7 days)
Next Topic: Website Creation Tutorial for Beginners
Goto Forum:
  

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ]

Current Time: Thu Sep 19 22:00:52 GMT 2024

Total time taken to generate the page: 0.04970 seconds