這是我的第二個問題,即使我認爲,我自己回答了前一個問題。無論如何,我有一個關於OOP的基本問題,關於如何從另一個類調用非靜態方法。例如: 我們在一個文件中的類命名爲A A.class.php如何從另一個類中調用非靜態方法
class A {
public function doSomething(){
//doing something.
}
}
,並在另一個文件中的第二類稱爲b B.class.php
require_once 'A.class.php';
class B {
//Call the method doSomething() from the class A.
}
我認爲現在是clearn 。如何:從類A調用方法doSomething()?
很簡單,謝謝! – Be0wulf
@MohamedAdibErrifai沒問題,希望它有幫助! – newfurniturey
我的帖子不錯的副本 – JvdBerg