Kenneth Burgener wrote:
Just for kicks and giggles here is my attempt. Not quite as elegant as
the others, but does the job. I included the one liner version below
just for fun.
If speed is of any concern there are a few immediate things you can do
to optimize.
1) quotes -- use single unless the string truly needs evaluation. This
is an extra step for php that is largely not needed. Especially inside
loops.
ex: echo time2sec('1:36') . "\n";
ex: if( $char == ':' ) {
2) echo -- use commas not periods, when there is no need to concatenate.
ex: echo time2sec('1:36'), "\n";
HTH,
--
Ritter
/*
PLUG: http://plug.org, #utah on irc.freenode.net
Unsubscribe: http://plug.org/mailman/options/plug
Don't fear the penguin.
*/