» Quick Links
You can make money on these forums
We Share profits with you
Google
Google Adsense
Google Adwords
YPN
Yahoo
MSN Search
Web Directories
Web Hosting
Web Hosting Offers
Hosting News
Suggestions
Link Building
Domain Names
PHP Forums
MySQL Forums
» More Links
OSP News
Reseller Hosting
Shared Hosting
Dedicated Servers
Google Adsense
Search Engine Marketing
Link Development
Affiliate Marketing


» Advertising
Multiple DC PR Check

Free SEO Tools


Go Back   Webmaster Forums > Website Developement / Programming > PHP Programming and Tips

PHP Programming and Tips Discuss about PHP programming and Share Tips. Ask questions about Scripting and Errors.

Reply
 
Thread Tools Display Modes
  #1  
Old 08-11-2006, 01:38 PM
kiefer kiefer is offline
OSP Starters
 
Join Date: Aug 2006
Posts: 6
Thanks: 0
Thanked 0 Times in 0 Posts
Rep Power: 0
kiefer is on a distinguished road
Default time to seconds

Hello,

I am writting a script that uses a flash player to tell the user what time the song is at. Well not being good with flash i finaly found a player I llike. The only prpblem is it uses 100 seconds for actually 60 seconds. Listed is an example of code below

//The timer i want to stop at is 1.58 basically 158.
$total = 100 + 58 / 1.6666666666666666666666666666667;
$time = round($total, 0); // This equals 135 which in realiaty is 1 minute 35 seconds.

What i want is how to convert the 136 to seconds.
If i could get the $time to equal 1:35 then i can just exploed the variable and times it by 60 but how can i explode the first number. Or actually the last two to be safe incase there are four numbers total. -- This message may have been cut off and the rest will only be shown to members. To become a member, click here --
Reply With Quote
Revenue Sharing Ads ( ?):
  #2  
Old 08-11-2006, 01:39 PM
heidi heidi is offline
OSP Starters
 
Join Date: Jul 2006
Posts: 8
Thanks: 0
Thanked 0 Times in 0 Posts
Rep Power: 0
heidi is on a distinguished road
Default

The number of seconds elapsed when the time is $time (in the 60 = 100 format) would be $time{0}*60 + $time{1}.$time{2}. Since $var{n} is the (n+1)th character of $var, so if I take the first character, muliptly by 60, and then add it to a concatenation of the second on third (Whicch represent the number of seconds) I have what I need. -- This message may have been cut off and the rest will only be shown to members. To become a member, click here --
Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Time change settings? Qhall MySQL Forums 4 01-28-2007 05:38 AM
minimum time.... dallas MySQL Forums 1 01-27-2007 06:17 AM
always the same time in server?? mirance Reseller Hosting Forum 1 12-14-2006 02:47 AM
Time Question odero PHP Programming and Tips 1 08-28-2006 01:40 PM
time on server side bevan PHP Programming and Tips 1 08-22-2006 01:09 PM


All times are GMT. The time now is 08:11 PM.