Rumah > Artikel > pembangunan bahagian belakang > 解读PHP递归数组的实际应用_PHP教程
我们在通过对PHP递归数组代码:
<ol class="dp-xml"> <li class="alt"><span><strong><font color="#006699"><span class="tag"></span><span class="tag-name">php</span></font></strong><span> </span></span></li> <li class=""><span>ignore_user_abort();//连线中断后(例如关闭浏览器)仍然继续执行以下的脚本直到处理完毕。 </span></li> <li class="alt"><span>set_time_limit(0); </span></li> <li class=""> <span>$</span><span class="attribute"><font color="#ff0000">get_data</font></span><span> = </span><span class="attribute-value"><font color="#0000ff">file_get_contents</font></span><span>("php://input"); </span> </li> <li class="alt"> <span>$</span><span class="attribute-value"><font color="#0000ff">explode</font></span><span class="attribute"><font color="#ff0000">explodeexplodedata</font></span><span> = explode("&", $get_data); </span> </li> <li class=""> <span>foreach ($explodedata as $</span><span class="attribute"><font color="#ff0000">key</font></span><span> =</span><span class="tag"><strong><font color="#006699">></font></strong></span><span> $value)//还原数组 </span> </li> <li class="alt"><span>{ </span></li> <li class=""><span>list($realkey, $realvalue) = explode("=", $value); </span></li> <li class="alt"><span>$data[urldecode($realkey)] = urldecode($realvalue); </span></li> <li class=""><span>} </span></li> <li class="alt"><span>//现在$data数组已经和a.php中的一样了,接下来,就可以根据自己的需要对$data数组进行操作了。 </span></li> <li class=""><span>//...... </span></li> <li class="alt"> <span></span><span class="tag"><strong><font color="#006699">?></font></strong></span><span> </span> </li> </ol>
上面这段代码就是PHP递归数组的详细代码,不知道对于初学PHP的新手们有没有什么帮助。