Ok, so here's an example:
a.php:
<?php
include 'b.php';
$yes = "yes";
$no = "no";
$maybe = "maybe";
$obj = new b($yes, $no, $maybe);
It passes 3 variables to b(). I want to have other things like that which will pass different amounts.
b.php:
class b {
public function __construct() {
$args = func_get_args();
// Loop through all variables somehow
$this->{all variables} = {value of all variables} // Create properties of each variable with their values
$this->example();
}
public function example() {
echo $this->yes;
// This should output "yes"
}
}