首页  >  文章  >  后端开发  >  PHP遍历有关问题,麻烦路过的有关问题

PHP遍历有关问题,麻烦路过的有关问题

WBOY
WBOY原创
2016-06-13 12:05:13834浏览

PHP遍历问题,麻烦路过的问题
数组:

<br />Array<br />(<br />    [doctorcomment] => Array<br />        (<br />            [0] => Array<br />                (<br />                    [status] => success<br />                    [strcommenttype] => 1<br />                    [strcommentcontent] => 萨达<br />                    [strcreatetime] => 2014-08-20<br />                    [strusername] => wanhui<br />                    [struserip] => 121.101.220.243<br />                    [strmobile] => 13910527603<br />                )<br /> <br />            [1] => Array<br />                (<br />                    [status] => success<br />                    [strcommenttype] => 2<br />                    [strcommentcontent] => sdfsd<br />                    [strcreatetime] => 2014-08-20<br />                    [strusername] => sdfds<br />                    [struserip] => 343.2432.432<br />                    [strmobile] => 18600085268<br />                )<br /> <br />            [2] => Array<br />                (<br />                    [status] => success<br />                    [strcommenttype] => 9<br />                    [strcommentcontent] => fsfddsf<br />                    [strcreatetime] => 2014-08-20<br />                    [strusername] => sdfdsdfd<br />                    [struserip] => 343.2432.432<br />                    [strmobile] => 18600085268<br />                )<br /> <br />        )<br /> <br />)<br /><br />

<br /><?<br />if( isset($arrGetDoctorComment) && !empty($arrGetDoctorComment) && is_array($arrGetDoctorComment) ) {<br />					<br />						foreach ($arrGetDoctorComment as $arr_3) {<br /><br />							foreach ($arr_3 as $value_3) {<br />								print_r($arr_3);<br />								if ( $value_3['strcommenttype'] == "9" ) {<br />									echo "<p style=\"font-size:14px;\">".$value_3['strcommentcontent']."</p>";<br />									echo "<br/>";<br />									echo "<span style=\"color:#757575;padding-bottom:10px;\">来自".$value_3['strusername']."  ".$value_3['strcreatetime']."></span>";<br />									echo "<br/>";<br />									echo "<hr/>";<br />								} else {<br />									echo "null date";	<br />								}<br />							}<br />						}<br />					}<br />?><br /><br /><br />

麻烦问问,我为什么取不出是3的值呢,取3的值的时候取的是1的值
------解决方案--------------------
3 在哪里?

                       foreach ($arrGetDoctorComment as $arr_3) {<div class="clear">
                 
              
              
        
            </div>
声明:
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系admin@php.cn