include的前提是class
<?php class teacher{ public $name='huahua'; public function callName(){ echo $this->name; } }
<?php include './demo.php'; $teacher=new teacher; $teacher->callName();