How do I make a PHP variable value visible to a PHP Class in another file?

Viewed 28

How do I make the variable item from one PHP file visible to a PHP class that is a different file?

The variable:

$item = "item";

The class:

class Item{
  public function getItem(){
     $result = $item + 5;
     echo $result;
  }
}
0 Answers
Related