Heim  >  Artikel  >  Backend-Entwicklung  >  PHP遍历有关问题,麻烦路过的有关问题

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

WBOY
WBOYOriginal
2016-06-13 12:05:13786Durchsuche

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>
Stellungnahme:
Der Inhalt dieses Artikels wird freiwillig von Internetnutzern beigesteuert und das Urheberrecht liegt beim ursprünglichen Autor. Diese Website übernimmt keine entsprechende rechtliche Verantwortung. Wenn Sie Inhalte finden, bei denen der Verdacht eines Plagiats oder einer Rechtsverletzung besteht, wenden Sie sich bitte an admin@php.cn