首頁  >  文章  >  後端開發  >  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