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 素材场景中光线烘焙后灯光失效
  • ¥15 请教一下各位,为什么我这个没有实现模拟点击
  • ¥15 执行 virtuoso 命令后,界面没有,cadence 启动不起来
  • ¥50 comfyui下连接animatediff节点生成视频质量非常差的原因
  • ¥20 有关区间dp的问题求解
  • ¥15 多电路系统共用电源的串扰问题
  • ¥15 slam rangenet++配置
  • ¥15 有没有研究水声通信方面的帮我改俩matlab代码
  • ¥15 ubuntu子系统密码忘记
  • ¥15 保护模式-系统加载-段寄存器