note 33767 added to function.is-a

Posted: 07-07-2003, 10:39 AM
>>> 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 -- http://www.php.net/manual/en/function.is-a.php
Edit Note -- http://master.php.net/manage/user-no...ion=edit+33767
Delete Note -- http://master.php.net/manage/user-no...767&report=yes
Reject Note -- http://master.php.net/manage/user-no...767&report=yes

Reply With Quote

Responses to "note 33767 added to function.is-a"

 
LinkBack Thread Tools Search this Thread Display Modes
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are Off
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
note 33730 added to function.min Merome@wanadoo.fr PHP Notes 0 07-05-2003 02:40 PM
note 33727 added to function.is-int phpguru@gmx.ch PHP Notes 0 07-05-2003 01:50 PM
note 33714 added to function.register-tick-function icy2@bol.com.br PHP Notes 0 07-04-2003 06:21 PM
note 33689 added to function.next php-general@lists.php.net PHP Notes 1 07-04-2003 02:01 AM
note 33575 added to function.register-shutdown-function jules@sitepointAASASZZ.com PHP Notes 0 07-01-2003 05:41 AM