Home >Backend Development >PHP Tutorial >PHP遍历有关问题,麻烦路过的有关问题

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

WBOY
WBOYOriginal
2016-06-13 12:05:13864browse

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>
Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn