Creating Set Get magic method

Simple Set Get magic method, which will set and get values. Without passing the arguments into the function. We will create new class call push, which will have setData and getData function. <?php class push { public $result = ''; function setData() { $this->result .= ' to codeasearch.com '.date("Y-m-d"); } function getData() { echo $this->result; […]