PHP: is there a way to see “invisible” characters like \n

后端 未结 5 1549
北荒
北荒 2020-12-14 01:52

Is there a way to see invisible characters like whitespace, newlines, and other non-printing characters in a manner like print_r() ?

Reason is there is some sort of

5条回答
  •  死守一世寂寞
    2020-12-14 02:22

    You can use the addcslashes function:

    string addcslashes ( string $str, string $charlist )

    which will return a string with backslashes before characters. An example would be:

    
    

提交回复
热议问题