goba Sat Mar 30 11:48:55 2002 EDT
Modified files:
/phpdoc/en/functions var.xml
Log:
Some clarifications on unserialize()
Index: phpdoc/en/functions/var.xml
diff -u phpdoc/en/functions/var.xml:1.101 phpdoc/en/functions/var.xml:1.102
--- phpdoc/en/functions/var.xml:1.101 Sat Mar 30 06:30:56 2002
+++ phpdoc/en/functions/var.xml Sat Mar 30 11:48:55 2002
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="iso-8859-1"?>
-<!-- $Revision: 1.101 $ -->
+<!-- $Revision: 1.102 $ -->
<reference id="ref.variables">
<title>Variable Functions</title>
<titleabbrev>Variables</titleabbrev>
@@ -1133,8 +1133,6 @@
back into a PHP value. The converted value is returned, and can
be an <type>integer</type>, <type>float</type>,
<type>string</type>, <type>array</type> or <type>object</type>.
- If an object was serialized, its methods are not preserved in the
- returned value.
</simpara>
<note>
<para>
@@ -1144,7 +1142,7 @@
Use your &php.ini;, <function>ini_set</function> or .htaccess-file
to define 'unserialize_callback_func'.
Everytime an undefined class should be instanciated, it'll be called.
- To disable this feature just empty this global variable.
+ To disable this feature just empty this setting.
</para>
</note>
<para>
@@ -1179,9 +1177,9 @@
<title><function>unserialize</function> example</title>
<programlisting role="php">
<![CDATA[
-// Here, we use unserialize() to load session data from a database
-// into $session_data. This example complements the one described
-// with <function>serialize</function>.
+// Here, we use unserialize() to load session data to the
+// $session_data array from the string selected from a database.
+// This example complements the one described with serialize().
$conn = odbc_connect ("webdb", "php", "chicken");
$stmt = odbc_prepare ($conn, "SELECT data FROM sessions WHERE id = ?");
@@ -1193,8 +1191,8 @@
// we should now have the serialized data in $tmp[0].
$session_data = unserialize ($tmp[0]);
if (!is_array ($session_data)) {
- // something went wrong, initialize to empty array
- $session_data = array();
+ // something went wrong, initialize to empty array
+ $session_data = array();
}
}
]]>