Class Thread { var $topic; Post Topic var $body; Post Content var $date; Post release time var $author; Post author function thread for initializing variables, etc. function Thread () { Initialize variables } function Send to submit a new post function Send () { To detect the legality of a variable and perform an insert operation to store the variable in the database } function edit for editing posts function Edit () { Perform update operation after checking the legality of variables store variables in the database } function Delete to delete a post function Delete () { When the author's permissions are detected, the relevant data is deleted from the database } } Class Mainthread extends Thread { var $id; Post Number var $board; The discussion area where the post is located var $allowreply; Whether to allow replies constructors, for initializing variables function Mainthread ($id, $board, $allowreply) { Used to initialize variables } function Send () { To detect the legality of a variable and perform an insert operation to store the variable in the database Parent::send (); The Send function that is used to call the base class } function Edit () { Perform update operation after checking the legality of variables store variables in the database Parent::edit (); The edit function to call the base class } } $th = new Thread; Create a new object if ($th instanceof thread)//If the object $th is of type thread, output Yes echo "Yes"; Else echo "No"; ?> |