Warning: file_get_contents(/data/phpspider/zhask/data//catemap/8/mysql/65.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Php 使用file_get_html();返回带有特殊字符的HTML,即使我使用->;明文_Php_Mysql - Fatal编程技术网

Php 使用file_get_html();返回带有特殊字符的HTML,即使我使用->;明文

Php 使用file_get_html();返回带有特殊字符的HTML,即使我使用->;明文,php,mysql,Php,Mysql,好的,我在这个问题上花了很多时间,我想从一个外部页面获得一个标签,所以我这样做: $dom = file_get_html($url); $name = $dom->find('h1'); $name = $name[0]->plaintext; 该网站将h1标记的内容显示为:Grandon多用途HTML模板 当我回显$name时,它是:Grandon多用途HTML模板 但当我将其保存在MySQL中时,它会变成: Grandon Multi-Purpose H

好的,我在这个问题上花了很多时间,我想从一个外部页面获得一个标签,所以我这样做:

$dom = file_get_html($url); 

$name = $dom->find('h1'); 
$name = $name[0]->plaintext;
该网站将h1标记的内容显示为:Grandon多用途HTML模板

当我回显$name时,它是:Grandon多用途HTML模板

但当我将其保存在MySQL中时,它会变成:

Grandon Multi-Purpose HTML Template
当我保存页面的源代码时,它还显示:

Grandon Multi-Purpose HTML Template
有没有什么快速的方法可以将这些特殊字符替换为它们的实际值?

有。使用:


Yeees,谢谢谢谢谢谢:)!
$name = html_entity_decode($name[0]->plaintext);