php calls methods in other php
First pass the four "include", "include_once", "require", and "require_noce" For any one of these functions, introduce other PHP files, and finally write the method that needs to be called.
Code example
A.php
<?php //定义方法 function func_a() { echo "我是A.php中的方法!"; }
B.php
<?php require './A.php'; //调用A.php中的方法 func_a();
Output result: I am a method in A.php!
The above is the detailed content of php calls methods in other php. For more information, please follow other related articles on the PHP Chinese website!