Ask a Question related to PHP Notes, Design and Development.
-
kerxen@caramail.com #1
note 33767 added to function.is-a
>>> USE OF CLASSES, OBJECTS and SESSIONS. <<<
If you have an object, or an array that used in many pages, you need to serialize/unserialize it.
exampla:
include("class.example.php");
$object = new example ();
$se_obj = serialize($object);
$_SESSION['se_obj']=$se_obj; // here, the object is is the SESSION as a global variable
It won't be destroyed when you change pages.
when you then got on the next page and so a session_start(), you must have included a class definition first.
and you don't habe included the class description, your object will still not break.
Just do a:
include("class.example.php");
$object = unserialze($_SESSION['se_obj']);
and all is fine.
Eddy Cingala
----
Manual Page -- [url]http://www.php.net/manual/en/function.is-a.php[/url]
Edit Note -- [url]http://master.php.net/manage/user-notes.php?action=edit+33767[/url]
Delete Note -- [url]http://master.php.net/manage/user-notes.php?action=delete+33767&report=yes[/url]
Reject Note -- [url]http://master.php.net/manage/user-notes.php?action=reject+33767&report=yes[/url]
kerxen@caramail.com Guest
-
note 33827 added to function.function-exists
This can be used to conditionally define a user function. In this sense, it can act as a sort of inline include_once(). For example, suppose you... -
note 33727 added to function.is-int
To Logan: There's also a simple non-regexp way to convert a (form) value into an integer if it consists of numbers only - although with a trap... -
note 33714 added to function.register-tick-function
please can anyone help me to discover if this function can be used to make a chat ---- Manual Page --... -
note 33689 added to function.next
i was just looking around and saw this. i'd just like to say "huh" and be on my merry way. ok buh-bi. merry meet, rose love ---- Manual Page --... -
note 33575 added to function.register-shutdown-function
If your script exceeds the maximum execution time, and terminates thusly: Fatal error: Maximum execution time of 20 seconds exceeded in - on line...



Reply With Quote

