I have two php files. one for class(Library), this class name() function returns variable, I want to access returned variable name to another php file. thank u.
One.php
<?php
class One
{
public function name()
{
$name = "SampleName";
return $name;
}
}
?>
Two.php
<?php
require_once("One.php");
$data = new One();
$data->name();
//$name = $this->name(); // I tried like this but not access
//echo $name;
?>