[Solved] OO PHP, class function variable [closed]


The code will go like this:-

List.php

class listPage
{
  public $category;

  function __construct()
  {
    $this->category = '';
  }
  function setCategory($value)
  {
     $this->category=$value;
     echo $this->category;
  }
}

Controller.php

$start = new listPage();
$start->setCategory(3);

0

solved OO PHP, class function variable [closed]