问题描述
执行返回报错结果: failed to open stream: No such file or directory
问题分析
$response = file_get_contents("C:\www\demo\ÖVRIGT_1700к-1.html");
*在 url中发现,包含了特殊字符'Ö','к'
问题解决
iconv()函数是PHP中的内置函数,用于将字符串转换为请求的字符编码。
iconv()是国际标准转换应用程序命令行编程接口,该接口通过Unicode转换将不同的字符编码转换为其他编码类型。
// code
$url = iconv('utf-8', 'gbk', "C:\www\demo\ÖVRIGT_1700к-1.html");
$response = file_get_contents($url);