This post is going to help you if you want to update data in a property (variable) of class in object-oriented programming from outside of the class in PHP. See example-
<?php
class test{
public $x;
}
$result = new test();
$result->x = "Jaischool";
// now print the data from x property
echo $result->x;
?>
Publish A Comment