note 12651 deleted from function.session-encode by didou
| From: | didou@php.net | Date: | Sun, 18 May 2003 03:38:37 +0000 |
| Subject: | note 12651 deleted from function.session-encode by didou | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-48381@lists.php.net to get a copy of this message | ||
Note Submitter: simon@studio24.net
----
a good use of this is to print out session variables, handy for debugging scripts..
function session_dump() {
// dumps info about a session
$session_array = explode(";",session_encode());
$html = "<!-- SESSION VARIABLES DUMP\n\n";
for ($x = 0; $x < count($session_array); $x++) {
$html .= " $session_array[$x] \n";
}
$html .= " -->\n\n";
return $html;
}
call it by echo session_dump();
session_encode() returns variables in the form:
variable name|type:string length:value
ie. user_nm|s:6:"simonj"
simon
http://www.studio24.net