Re: how do I convert a # to time?

Roger Raymond <roger-vp4IRbjYgwNWk0Htik3J/[email protected]>
Newsgroups gmane.comp.cms.xaraya.curiosa
Organization Xaraya News Server
Message-ID <[email protected]>

Roger Raymond wrote:
> 
> 
> mulpinBR - 111.898.068 > http://br.xaraya.com wrote:
> 
>> function ReadTime($readtxt) {
>>  $readspeed = CountWords($readtxt);
>>  $readtimeraw = $readspeed / 150;
>>  list($min,$secs) = explode('.',$readtimeraw);
>>  $secs = "0.$secs";
>>  $secs = floor(60*($secs/10));
>>  $readtime = "$min'$secs\"";
>> return($readtime);
> 
> 
> Dunno if it's faster, but it's smaller :)
> 
> function ReadTime($readtxt)
> {
>     list($min,$sec) = explode('.',(CountWords($readtxt)/150));
>     $secs = floor(60*("0.$secs"));
>     return "$min'$secs\"";
> }
> 


You might even want to pass in the $readtxt by reference as well, just 
for memory savings by changing the var list in the function like:

function ReadTime(&$readtxt)
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.