i want to ask how to pass parameter between two classes in two different files?
ex:
class a{
function aa(){
$var1 = 10;
return $var1;
}
}
//in different file
class b{
function bb(){
echo"$var1"; //how this can be achieved?
}
}
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
None of the answers here are right, since the op is asking to pass the parameter and not call it. The correct way to do it, is by creating an object of class b