php 如何使用var_dump获取所有元素?
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/16278102/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
How to get all elements with var_dump?
提问by csaron92
How do I get all of elements with var_dump
?
I have a huge array but var_dump
prints only the first x elemets, and I need all of them to check if my sql is correct.
我如何获得所有元素var_dump
?我有一个巨大的数组,但var_dump
只打印前 x 个元素,我需要所有这些元素来检查我的 sql 是否正确。
回答by Maulik Vora
try
尝试
echo '<pre>';
print_r($your_array);
echo '</pre>';
This will not show you type/size of the array elements as var_dump but will show you full array.
这不会将数组元素的类型/大小显示为 var_dump,但会显示完整数组。
回答by Dom
Try print_r
e.g.
尝试print_r
例如
print_r($myarray);