php数组输出的问题
PHP code1 2 3 4 5 6 7 8 9 10 11 | <!--
Code highlighting produced by Actipro CodeHighlighter (freeware)
http:
-->
foreach ( $list as $value )
{
$this ->output .= $value [ 'q_username' ];
$this ->output .= print_r( $value );
}
|
로그인 후 복사
两个输出语句,a输出空白,b用print_r的方法可以输出数组的结构,有值,名称也是q_username
为啥就输不出来呢
------解决方案--------------------PHP code1 2 3 4 5 6 7 | foreach ( $list as $key => $value )
{
$this ->output .= $value [ 'q_username' ];
$this ->output .= print_r( $value );
}
<br><font color= "#e78608" >------解决方案--------------------</font><br>把第二行前面的 $this ->output .=去掉看看。<br> foreach ( $list as $value ) { <br> $this ->output .= $value [ 'q_username' ];
<br><font color= "#e78608" >------解决方案--------------------</font><br>
|
로그인 후 복사
------解决方案--------------------