我需要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