我需要file_get_contents()
函数的帮助。使用file_get_contents和希伯来字符串
当我试图从包含一些希伯来字符的url中获取数据时,我从主机(无效链接)收到错误。
例如:
file_get_contents('http://domain.com/page/עברית');
不为我工作。
我需要file_get_contents()
函数的帮助。使用file_get_contents和希伯来字符串
当我试图从包含一些希伯来字符的url中获取数据时,我从主机(无效链接)收到错误。
例如:
file_get_contents('http://domain.com/page/עברית');
不为我工作。
网址不能包含UTF-8字符。他们必须先进行网址编码。它们可能会在浏览器中显示为UTF-8字符,但这只是您的浏览器使它看起来更漂亮。
When a new URI scheme defines a component that represents textual
data consisting of characters from the Universal Character Set [UCS],
the data should first be encoded as octets according to the UTF-8
character encoding [STD63]; then only those octets that do not
correspond to characters in the unreserved set should be percent-
encoded. For example, the character A would be represented as "A",
the character LATIN CAPITAL LETTER A WITH GRAVE would be represented
as "%C3%80", and the character KATAKANA LETTER A would be represented
as "%E3%82%A2".
什么错误说?你有没有试过utf8_encode? – Jonast92 2013-03-17 23:13:00
对希伯来字符进行URL编码可能工作 – ajreal 2013-03-17 23:14:50
该URL在浏览器中不起作用 – MatRt 2013-03-17 23:14:52