pbootcms网站模板|日韩1区2区|织梦模板||网站源码|日韩1区2区|jquery建站特效-html5模板网

    • <bdo id='ygOlN'></bdo><ul id='ygOlN'></ul>
  • <small id='ygOlN'></small><noframes id='ygOlN'>

      <i id='ygOlN'><tr id='ygOlN'><dt id='ygOlN'><q id='ygOlN'><span id='ygOlN'><b id='ygOlN'><form id='ygOlN'><ins id='ygOlN'></ins><ul id='ygOlN'></ul><sub id='ygOlN'></sub></form><legend id='ygOlN'></legend><bdo id='ygOlN'><pre id='ygOlN'><center id='ygOlN'></center></pre></bdo></b><th id='ygOlN'></th></span></q></dt></tr></i><div class="cgp7c8r" id='ygOlN'><tfoot id='ygOlN'></tfoot><dl id='ygOlN'><fieldset id='ygOlN'></fieldset></dl></div>
        <legend id='ygOlN'><style id='ygOlN'><dir id='ygOlN'><q id='ygOlN'></q></dir></style></legend>
      1. <tfoot id='ygOlN'></tfoot>

        file_exists() 和 file_get_contents() 在 PHP 中名為 outpu

        file_exists() and file_get_contents() fail on a file which is named output?#213;#205;#213;#165;.txt in PHP?(file_exists() 和 file_get_contents() 在 PHP 中名為 output?.txt 的文件上失敗?) - IT屋-程序員軟件開發技術分享社
          <bdo id='els21'></bdo><ul id='els21'></ul>

              <i id='els21'><tr id='els21'><dt id='els21'><q id='els21'><span id='els21'><b id='els21'><form id='els21'><ins id='els21'></ins><ul id='els21'></ul><sub id='els21'></sub></form><legend id='els21'></legend><bdo id='els21'><pre id='els21'><center id='els21'></center></pre></bdo></b><th id='els21'></th></span></q></dt></tr></i><div class="ny8gua2" id='els21'><tfoot id='els21'></tfoot><dl id='els21'><fieldset id='els21'></fieldset></dl></div>

                  <tbody id='els21'></tbody>
                <legend id='els21'><style id='els21'><dir id='els21'><q id='els21'></q></dir></style></legend>

                  <small id='els21'></small><noframes id='els21'>

                  <tfoot id='els21'></tfoot>
                • 本文介紹了file_exists() 和 file_get_contents() 在 PHP 中名為 output?ÕÍÕ¥.txt 的文件上失敗?的處理方法,對大家解決問題具有一定的參考價值,需要的朋友們下面隨著小編來一起學習吧!

                  問題描述

                  file_exists()file_get_contents() 在名為 output??í?¥.txt 的文件上失敗(例如),雖然我知道它存在?

                  file_exists() and file_get_contents() fail on a file which is named output??í?¥.txt (as an example), although I know it exists?

                  我猜它與文件名中的特殊字符有關嗎?.

                  I'm guessing its got something to do with the special characters within the file name?.

                  所以想知道有什么解決方法嗎?

                  So was wondering whats a workaround?

                  感謝所有回復.

                  僅供參考:

                  請注意,如果您想為什么不簡單地更改文件名?- 我不能因為文件名是一般生成的,并且更改文件名將意味著使用 PHP 的文件函數(這似乎不允許文件名 args 中的特殊字符 - 除非我誤解/誤解了任何東西).

                  Please note, if your thinking why not simply change the file name? - I can't as the file name is generated generically, and to change the file name will be mean using PHP's file functions (which don't seem to allow special characters within the file name args - unless I've misinterpreted/misunderstood anything).

                  我在 Windows 上使用 PHP 5.2.

                  I'm using PHP 5.2 on Windows.

                  推薦答案

                  確保文件系統的編碼與 PHP 代碼中包含文件名的字符串的編碼相同.

                  Ensure that the encoding of the file-system is the same as the encoding of the string that contains the file-name in your PHP code.

                  否則您正在測試是否存在錯誤的文件.

                  Otherwise you're testing for the wrong file to exist.

                  例如,如果您的文件系統不支持 UTF-8,但文件名以 UTF-8 編碼.

                  For example, if your file-system does not support UTF-8 but the file-name is encoded in UTF-8.

                  所以你評論說文件名是 UTF-8 并且你使用的是 windows.

                  So you have commented that the filename is in UTF-8 and you're using windows.

                  這正是我回答的重點.正如此處所寫:

                  That's exactly the point my answer was about. As written here:

                  Windows 用戶的壞消息:Windows 文件系統(FAT、FAT32、NTFS)不支持 UTF-8.根據文件系統和本地化,文件名以 ISO-8859-1 或 CP437/CP850/(或任何適合您的語言的方式)編碼.因此,如果您遵循本指南,則在嘗試將文件名從數據庫匹配到文件系統時可能會遇到麻煩.(雖然我從未嘗試過.)

                  Bad news for Windows Users: Windows filesystems (FAT, FAT32, NTFS) are not UTF-8 aware. Filenames are encoded in ISO-8859-1 or CP437/CP850/( or whatever suits your language) depending on filesystem and localisation. So you will probably get in trouble trying to match filenames from database to filesystem if you follow this guide. (Although I've never tried it.)

                  Windows 解決方法:現代 Windows 版本在安裝的共享上支持 UTF-8.共享您的媒體文件夾并將其安裝為網絡驅動器.

                  Windows workaround: Modern windows versions support UTF-8 on mounted shares. Make a share of your mediafolder and mount it as a network drive.

                  因此,要么進行共享,要么以實際適用于您的文件系統的編碼方式對文件名進行編碼.這不是 PHP 中的錯誤.您只是沒有檢查正確的文件名,僅此而已.

                  So either make a share or encode the filename in the encoding that actually works with your filesystem. This is not a bug in PHP. You're just no checking for the right file-name, that's all.

                  編輯 2:

                  假設您有 NTFS,它可能接受 UTF-16(這不是真正精確的 AFAIK,但您可以嘗試一下),您可以將 UTF-8 文件名轉換為 UTF-16名稱:

                  Assuming you have NTFS which might accept UTF-16 (which is not really precise AFAIK, but you can give it a try), you could convert the UTF-8 filename into an UTF-16 fi?ename:

                  $name = mb_convert_encoding($name, 'UTF-16', 'UTF-8');
                  

                  然后嘗試 file_exists 是否有效.請記住,他在技術上可能不正確,而且可能還有一個額外的編碼問題,即使進行了這種重新編碼,也無法正確使用.

                  And then try if file_exists works. Keep in mind that his might not be technically correct, and you might have an additional encoding issue which prevents you from correct use even with this re-encoding.

                  相關:NTFS 中的文件名存儲為什么編碼?

                  這篇關于file_exists() 和 file_get_contents() 在 PHP 中名為 output?ÕÍÕ¥.txt 的文件上失敗?的文章就介紹到這了,希望我們推薦的答案對大家有所幫助,也希望大家多多支持html5模板網!

                  【網站聲明】本站部分內容來源于互聯網,旨在幫助大家更快的解決問題,如果有圖片或者內容侵犯了您的權益,請聯系我們刪除處理,感謝您的支持!

                  相關文檔推薦

                  Deadlock exception code for PHP, MySQL PDOException?(PHP、MySQL PDOException 的死鎖異常代碼?)
                  PHP PDO MySQL scrollable cursor doesn#39;t work(PHP PDO MySQL 可滾動游標不起作用)
                  PHP PDO ODBC connection(PHP PDO ODBC 連接)
                  Using PDO::FETCH_CLASS with Magic Methods(使用 PDO::FETCH_CLASS 和魔術方法)
                  php pdo get only one value from mysql; value that equals to variable(php pdo 只從 mysql 獲取一個值;等于變量的值)
                  MSSQL PDO could not find driver(MSSQL PDO 找不到驅動程序)

                    <tfoot id='DmOJ9'></tfoot>

                    <small id='DmOJ9'></small><noframes id='DmOJ9'>

                        <bdo id='DmOJ9'></bdo><ul id='DmOJ9'></ul>

                            <tbody id='DmOJ9'></tbody>

                        • <legend id='DmOJ9'><style id='DmOJ9'><dir id='DmOJ9'><q id='DmOJ9'></q></dir></style></legend>

                          <i id='DmOJ9'><tr id='DmOJ9'><dt id='DmOJ9'><q id='DmOJ9'><span id='DmOJ9'><b id='DmOJ9'><form id='DmOJ9'><ins id='DmOJ9'></ins><ul id='DmOJ9'></ul><sub id='DmOJ9'></sub></form><legend id='DmOJ9'></legend><bdo id='DmOJ9'><pre id='DmOJ9'><center id='DmOJ9'></center></pre></bdo></b><th id='DmOJ9'></th></span></q></dt></tr></i><div class="8ds8o8w" id='DmOJ9'><tfoot id='DmOJ9'></tfoot><dl id='DmOJ9'><fieldset id='DmOJ9'></fieldset></dl></div>
                            主站蜘蛛池模板: 精密模具制造,注塑加工,吹塑和吹瓶加工,EPS泡沫包装生产 - 济南兴田塑胶有限公司 | 衬氟止回阀_衬氟闸阀_衬氟三通球阀_衬四氟阀门_衬氟阀门厂-浙江利尔多阀门有限公司 | 塑钢课桌椅、学生课桌椅、课桌椅厂家-学仕教育设备首页 | 西安微信朋友圈广告投放_微信朋友圈推广_西安度娘网络科技有限公司 | 仪器仪表网 - 永久免费的b2b电子商务平台 | 直线模组_滚珠丝杆滑台_模组滑台厂家_万里疆科技 | 液压扳手-高品质液压扳手供应商 - 液压扳手, 液压扳手供应商, 德国进口液压拉马 | 校服厂家,英伦校服定做工厂,园服生产定制厂商-东莞市艾咪天使校服 | 不锈钢复合板|钛复合板|金属复合板|南钢集团安徽金元素复合材料有限公司-官网 | 【365公司转让网】公司求购|转让|资质买卖_股权转让交易平台 | 齿轮减速机电机一体机_齿轮减速箱加电机一体化-德国BOSERL蜗轮蜗杆减速机电机生产厂家 | 苏州柯瑞德货架-仓库自动化改造解决方案 | 找培训机构_找学习课程_励普教育| 水质监测站_水质在线分析仪_水质自动监测系统_多参数水质在线监测仪_水质传感器-山东万象环境科技有限公司 | 北京西风东韵品牌与包装设计公司,创造视觉销售力! | 展厅设计公司,展厅公司,展厅设计,展厅施工,展厅装修,企业展厅,展馆设计公司-深圳广州展厅设计公司 | MVE振动电机_MVE震动电机_MVE卧式振打电机-河南新乡德诚生产厂家 | 喷涂流水线,涂装流水线,喷漆流水线-山东天意设备科技有限公司 | MTK核心板|MTK开发板|MTK模块|4G核心板|4G模块|5G核心板|5G模块|安卓核心板|安卓模块|高通核心板-深圳市新移科技有限公司 | 阻垢剂-反渗透缓蚀阻垢剂厂家-山东鲁东环保科技有限公司 | 防腐木批发价格_深圳_惠州_东莞防腐木厂家_森源(深圳)防腐木有限公司 | 河南卓美创业科技有限公司-河南卓美防雷公司-防雷接地-防雷工程-重庆避雷针-避雷器-防雷检测-避雷带-避雷针-避雷塔、机房防雷、古建筑防雷等-山西防雷公司 | 阳光模拟试验箱_高低温试验箱_高低温冲击试验箱_快速温变试验箱|东莞市赛思检测设备有限公司 | 高低温试验箱-模拟高低温试验箱订制-北京普桑达仪器科技有限公司【官网】 | 广州印刷厂_广州彩印厂-广州艺彩印务有限公司 | 立式_复合式_壁挂式智能化电伴热洗眼器-上海达傲洗眼器生产厂家 理化生实验室设备,吊装实验室设备,顶装实验室设备,实验室成套设备厂家,校园功能室设备,智慧书法教室方案 - 东莞市惠森教学设备有限公司 | 多米诺-多米诺世界纪录团队-多米诺世界-多米诺团队培训-多米诺公关活动-多米诺创意广告-多米诺大型表演-多米诺专业赛事 | 黑龙江京科脑康医院-哈尔滨精神病医院哪家好_哈尔滨精神科医院排名_黑龙江精神心理病专科医院 | 根系分析仪,大米外观品质检测仪,考种仪,藻类鉴定计数仪,叶面积仪,菌落计数仪,抑菌圈测量仪,抗生素效价测定仪,植物表型仪,冠层分析仪-杭州万深检测仪器网 | 无压烧结银_有压烧结银_导电银胶_导电油墨_导电胶-善仁(浙江)新材料 | 压滤机-洗沙泥浆处理-压泥机-山东创新华一环境工程有限公司 | 英国雷迪地下管线探测仪-雷迪RD8100管线仪-多功能数字听漏仪-北京迪瑞进创科技有限公司 | 海德莱电力(HYDELEY)-无功补偿元器件生产厂家-二十年专业从事电力电容器 | 安徽合肥项目申报咨询公司_安徽合肥高新企业项目申报_安徽省科技项目申报代理 | 书法培训-高考书法艺考培训班-山东艺霖书法培训凭实力挺进央美 | 塑料脸盆批发,塑料盆生产厂家,临沂塑料广告盆,临沂家用塑料盆-临沂市永顺塑业 | 湖南自考_湖南自学考试网 | 无压烧结银_有压烧结银_导电银胶_导电油墨_导电胶-善仁(浙江)新材料 | 热熔胶网膜|pes热熔网膜价格|eva热熔胶膜|热熔胶膜|tpu热熔胶膜厂家-苏州惠洋胶粘制品有限公司 | 艾默生变频器,艾默生ct,变频器,ct驱动器,广州艾默生变频器,供水专用变频器,风机变频器,电梯变频器,艾默生变频器代理-广州市盟雄贸易有限公司官方网站-艾默生变频器应用解决方案服务商 | 钛合金标准件-钛合金螺丝-钛管件-钛合金棒-钛合金板-钛合金锻件-宝鸡远航钛业有限公司 |