var_dump报告错误的字符串长度是什么意思? [英] What does it mean when var_dump reports the wrong string length?
本文介绍了var_dump报告错误的字符串长度是什么意思?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我试图弄清楚为什么变量没有触发应有的条件. var_dump报告类似以下内容:
I'm trying to figure out why a variable isn't triggering a conditional that it should. var_dump reports something like this:
string(20) "0"
为什么当长度明显为1时报告长度为20?
Why is it reporting a length of 20 when the length is clearly 1?
推荐答案
它可能正在呈现html.即var_dump('<p class="abc">0</p>')
会向肉眼输出string(20) "0"
It might be rendering html. i.e. var_dump('<p class="abc">0</p>')
would output string(20) "0"
to the naked eye
这篇关于var_dump报告错误的字符串长度是什么意思?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文