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
    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);
    点赞 评论