相关推荐:《php教程》
首先在一个tool.php文件中声明一个类:
<?php class tool { function say(){ $result="hello,world"; return $result; }}
在另一文件main.php调用上面的类中的方法:
<?php require_once 'tool.php'; $tool=new tool(); $content=$tool->say(); echo $content;?>
以上就是php调用文件类的方法是什么的详细内容。
