Home >Backend Development >PHP Tutorial >PHP encounters problems obtaining the source code of iqiyi

PHP encounters problems obtaining the source code of iqiyi

WBOY
WBOYOriginal
2016-10-11 14:23:121036browse

PHP encounters problems obtaining the source code of iqiyi

<code>想要获取“http://so.iqiyi.com/so/q_入侵华尔街”目标网页的源代码,
但是得到的是“<title>&aelig;œ‰&auml;&raquo;‡&aring;&iquest;…&aelig;Š&yen;_视频在线观看-爱奇艺搜索</title>”

不知道“&aelig;œ‰&auml;&raquo;‡&aring;&iquest;…&aelig;Š&yen;”是什么编码格式?</code>

Reply content:

PHP encounters problems obtaining the source code of iqiyi

<code>想要获取“http://so.iqiyi.com/so/q_入侵华尔街”目标网页的源代码,
但是得到的是“<title>&aelig;œ‰&auml;&raquo;‡&aring;&iquest;…&aelig;Š&yen;_视频在线观看-爱奇艺搜索</title>”

不知道“&aelig;œ‰&auml;&raquo;‡&aring;&iquest;…&aelig;Š&yen;”是什么编码格式?</code>

html_entity_decode()

In fact, you should urlencode it. My test was normal and it was not encoded

<code>$data = file_get_contents('http://so.iqiyi.com/so/q_' . urlencode('入侵华尔街'));

var_dump($data);
</code>
Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn