Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
在我的页面中,我尝试打开一些 xml 文件:
$xml = simplexml_load_file("users/" .$f->name."/data.xml");
问题是$f->name可以将字符包含为带重音的元音,因此打开文件时会出错。例如,它读 García 而不是 García。我该如何解决?(我已经尝试过utf8_encode($f->name))
$f->name
utf8_encode($f->name)
尝试:
$xml = simplexml_load_file("users/" .rawurlencode($f->name)."/data.xml");