GetData();echo $str; // 无">
时间:2021-07-01 10:21:17 帮助过:3人阅读
class CTest
{
private $m_str;
public function SetData($data)
{
$m_str=$data;
}
public function GetData()
{
return $m_str;
}
}
?>
echo "Begin test
"; // 正常显示
require_once './tt.php';
$p=new CTest();
$p->SetData("Could you get this data?");
$str=$p->GetData();
echo $str; // 无法正常显示
?>
class CTest
{
private $m_str;
public function SetData($data)
{
$this->m_str=$data;
}
public function GetData()
{
return $this->m_str;
}
}