print_r为何多输出一个1?
奇怪,第一次看到这样子。
<!--Code highlighting produced by Actipro CodeHighlighter (freeware)http://www.CodeHighlighter.com/-->class test { public $test = array(); function test() { $this -> test[] = 'ok'; } function _echo() { foreach ($this -> test as $val) echo print_r($val); } } $test = new test(); $test -> _echo();
echo print_r($var,true);<br><font color="#e78608">------解决方案--------------------</font><br>1 是print_r()函数的返回值<div class="clear"> </div>