How to import a class written by yourself in php

If the class you write is written in the current php file, instantiate it directly.
If your class is written in another php file, you must first use include or require to introduce the class file into
<?php   
  include("class.php" );//Include the target file 
  $className = new Class();//Instantiate the target class 
  $className->show(); //This accesses the methods in the target class.
?>

Guess you like

Origin http://10.200.1.11:23101/article/api/json?id=326780970&siteId=291194637