/ Published in: PHP
Expand |
Embed | Plain Text
Copy this code and paste it in your HTML
<?php // classa.inc: class A { public $one = 1; public function show_one() { echo $this->one; } } // page1.php: include("classa.inc"); $a = new A; // store $s somewhere where page2.php can find it. // page2.php: // this is needed for the unserialize to work properly. include("classa.inc"); // now use the function show_one() of the $a object. $a->show_one(); ?>