i am new to php oop
I have an two files Here is my code
1)info.php
public $bd, $db1;
class Connection {
function connect() {
$this->db = 'hello world';
$this->db1 = 'hi'
}
}
2) prd.php
require_once 'info.php'
class prdinfo {
function productId() {
echo Connection::connect()->$bd;
echo Connection::connect()->$db1;
}
$prd = new prdinfo ();
$prd->productId ();
how i can echo my var in 2nd class i have tried in that way but i am not getting proper output
Thanks