Never mind that just needs a space....
Thanx for all the help...

have a surf to http://forum.ywait.co.za/  register and then i'll make you a
MOD for the php scripting forum board.
for the future.

if you want

Cheerz


"Danny Shepherd" <[EMAIL PROTECTED]> wrote in message
022001c22696$087e4cc0$0200a8c0@DANNYS">news:022001c22696$087e4cc0$0200a8c0@DANNYS...
> You just knew there was a regexp version on the way, didn't you :)
>
> Danny.
>
> <?php
>
> function unixTime($time)
> {
>  $time=preg_replace('/(.{4})(.{2})(.{2})(.{2})(.{2})(.{2})/','\\1/\\2/\\3
> \\4:\\5:\\6',$time);
>  return strtotime($time);
> }
>
> $time1='20020707140000';
> $time2='20020707160000';
>
> $timeDiff=unixTime($time2)-unixTime($time1);
>
> echo "The two times are $timeDiff seconds apart";
> ?>
>
>
>



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to