PHP:有没有办法看到“不可见"的内容?像\ n这样的字符 [英] PHP: is there a way to see "invisible" characters like \n
本文介绍了PHP:有没有办法看到“不可见"的内容?像\ n这样的字符的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
是否可以通过诸如print_r()之类的方式查看不可见字符(如空格,换行符和其他非打印字符)?
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 character in my array that I can't see and breaking things.
Object Object
(
[name] => name
[numbers] => Array
(
[0] => 123
[1] => 456
[2] => 789
)
[action] => nothing
)
看到[0]和[1]之间的怪异空白吗?打印[0]时,也会换行.但是,我没有在哪里为[0]分配换行符,所以我很困惑.
See the weird whitespace between [0] and [1]? When printing out [0] a newline gets printed as well. But no where do I assign a newline to [0] so I'm quite confused.
在php中是否有类似于show_invisible(Object->numbers[0])
的内置函数,它将显示123\n
或类似内容?
Is there a built in function in php that's like show_invisible(Object->numbers[0])
and it will show 123\n
or similar?
推荐答案
查看全文