how can we call one class's method through another class's object in php
- by hello
I want to know that is there any method in PHP by which i can call one class's method from another class object. let me clear
here is one class
class A() {
public function showData(){
//here is method of class A
}
}
// here is another class
class B(){
public function getData(){
//some method in class B
}
}
//now i create two objects
$objA= new class A();
$objB=new class B();
now i want to call this
$objB->showData();<---
is that possible .. by any how method( using public, inheritence,child parent etc...)
please help me