Im new to classes and I dont really know how to do this. Since Im new to using classes and very bad at searching I decided to ask here. What I want is a function from a class passed to another function in a class.
I tried to call it as below but it couldnt find the variable $b
For example:
class a {
function one() {
$b->two();
}
}
class b {
function two() {
echo "two";
}
}
$a = new a();
$b = new b();
How do i achieve this?
Thanks in advance!