dqls67891 2012-03-31 23:03
浏览 56
已采纳

字符串中的字母之间的空字符

i have a problem using some php functions on a string i get from a file. When i read it in notepad++ it seems to have no spaces but when i echo in cmd there appear to be spaces between the letters, and if i capture that output in a file and read it with notepad++ those characters are red as a black NULL. How is that character expressed so i remove it. I am including a file since i cant write what happens here. thank you in advance

PS the string was written in a file with vbscript btw

  • 写回答

1条回答 默认 最新

  • doujia1988 2012-04-01 00:14
    关注

    Use str_replace:

    $str = file_get_contents("out.txt"); 
    $str = str_replace("\0", "", $str); 
    file_put_contents("out1.txt", $str);
    
    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论

报告相同问题?

悬赏问题

  • ¥15 有赏,i卡绘世画不出
  • ¥15 如何用stata画出文献中常见的安慰剂检验图
  • ¥15 c语言链表结构体数据插入
  • ¥40 使用MATLAB解答线性代数问题
  • ¥15 COCOS的问题COCOS的问题
  • ¥15 FPGA-SRIO初始化失败
  • ¥15 MapReduce实现倒排索引失败
  • ¥15 ZABBIX6.0L连接数据库报错,如何解决?(操作系统-centos)
  • ¥15 找一位技术过硬的游戏pj程序员
  • ¥15 matlab生成电测深三层曲线模型代码