[PHP] Re: Creating Session Variables

2003-04-03 Thread nooper
If you dont have register globals on, but find it convenient to access
$varname instead of $_SESSION['varname'],
you can extract($_SESSION), thought that has potential for other name
conflicts and confusion, so be careful if you use extract();

"Tom Rawson" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> Hmmm, this doesn't seem clear in the docs ...
>
> Consider this:
>
> function foo() {
> $_SESSION['varname'] = "test";
> .
> }
>
> At this point:
>
> - Can I reference $varname inside the function?  If so, must it be
> declared global first?  Or can I only reference it via
> $_SESSION['varname']?
>
> - Can I reference it outside the function (as $varname) after the
> function returns?
>
> In other words if one creates a variable by adding it to the session
> array, does it then become a variable in either the global or (though I
> can't quite imagine this) current local scope?
>
> Thanks,
>
>  --
>  Tom Rawson
>
>
>



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



[PHP] timestamp from uniqid()

2003-04-02 Thread nooper
Would there be a way to extract a timestamp from uniqid(), since the
function is based on the microsecond, and its purpose is not to be random in
anyway, simply unique. I understand that it is not supposed to act as a
timestamp, just wondering if anyone has a method of extracting a date or
time from a uniqid.
Thanks,
nooper




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