php数组输出的问题
- PHP code
<!---ecms Code highlighting produced by Actipro CodeHighlighter (freeware)http://www.CodeHighlighter.com/-->foreach($list as $value){ $this->output .= $value['q_username'];//a $this->output .= print<strong style="color:transparent">¥本文来源gaodai#ma#com搞@@代~&码网^</strong><small>搞gaodaima代码</small>_r($value);// b}
两个输出语句,a输出空白,b用print_r的方法可以输出数组的结构,有值,名称也是q_username
为啥就输不出来呢
——解决方案——————–
- PHP code
foreach($list as $key=>$value){ $this->output .= $value['q_username'];//a $this->output .= print_r($value);// b}
------解决方案--------------------
把第二行前面的 $this->output .=去掉看看。
foreach($list as $value) {
$this->output .= $value['q_username'];//a
print_r($value); // b
}
echo $this->output;
------解决方案--------------------
------解决方案--------------------