后端开发|php教程
nbsp,str,data,function,public
后端开发-php教程
PHP中一个文件调用另一个文件类的方法,然后输出出现乱码,求解!
tt.php文件
android 桌面宠物源码,vscode拉取和提交代码,ubuntu 门罗币,tomcat运行关键指标,回复可见 爬虫,php如何实现多态,三灶seo推广多少钱lzw
<?php
class CTest
{
private $m_str;
public function SetData($data)
{
$m_str=$data;
}
public function GetData()
{
return $m_str;
}
}
?>
文件test.php
应价交易源码,ubuntu磁盘挂载路径,tomcat项目跑不起来,杭州python爬虫,c和php语法类似,深圳SEO人员lzw
<?php
echo "Begin test
"; // 正常显示
require_once ./tt.php;
$p=new CTest();
$p->SetData("Could you get this data?");
$str=$p->GetData();
echo $str; // 无法正常显示
?>
——
在浏览器中显示test.php执行结果
Begin test
锘
多门店展示网站程序源码,内网穿透加vscode,ubuntu 复位 命令,java 中tomcat,sqlite web进销存,如何消除床上的爬虫的味道,php mysql 优化,蚌埠seo推广方法,网站源码hackv,网页的在线客服弹出来怎么做的,织梦猫免费模板lzw
——解决方案——————–
class CTest
{
private $m_str;
public function SetData($data)
{
$this->m_str=$data;
}
public function GetData()
{
return $this->m_str;
}
}
——解决方案——————–
请检查$data的编码与页面编码是否一致。
——解决方案——————–
设下页面的编码