----- Original Message -----
From: Cato Larsen <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Wednesday, August 15, 2001 9:03 PM
Subject: Re: [PHP-DB] Getting info from Cookie


> Thanks!
> But how do you extract a certain point of info from it?
>
> The info is seperated by "+" (without the "'s)
>
> I used:
> <?php echo $HTTP_COOKIE_VARS["TestCookie"]; ?>
>
> And I got  Cato+bec39d1ca1091da20b4a8ef5ecacfde8
>
> Where  bec39d1ca1091da20b4a8ef5ecacfde8 is the session id for the MySQL
> database, and Cato is what I want to extract.


Use explode() to split the string using "+". This returns an array with 2
elements and in your case you want the first element.

$parts = explode("+", $HTTP_COOKIE_VARS["TestCookie"]);
echo $parts[0]


regards
--
Jason Wong
Gremlins Associates
www.gremlins.com.hk




-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]

Reply via email to