<address id="ousso"></address>
<form id="ousso"><track id="ousso"><big id="ousso"></big></track></form>
  1. php語言

    php遞歸遍歷多維數組的方法

    時間:2025-04-11 23:13:56 php語言 我要投稿
    • 相關推薦

    php遞歸遍歷多維數組的方法

      文章主要介紹了php遞歸遍歷多維數組的方法,實例分析了php數組遍歷的相關技巧,具有一定參考借鑒價值,需要的朋友可以參考下.

      本文實例講述了php遞歸遍歷多維數組的方法。分享給大家供大家參考。具體如下:

      ?

      1

      2

      3

      4

      5

      6

      7

      8

      9

      10

      11

      12

      13

      14

      15

      <?php

      function get_array_elems($arrResult, $where="array"){

      while(list($key,$value)=each($arrResult)){

      if (is_array($value)){

      get_array_elems($value, $where."[$key]");

      }

      else {

      for ($i=0; $i<count($value);$i++){

      echo $where."[$key]=".$value."<BR>\n";

      }

      }

      }

      }

      get_array_elems($arrResult);

      ?>

      希望本文所述對大家的php程序設計有所幫助。

    【php遞歸遍歷多維數組的方法】相關文章:

    php遞歸遍歷刪除文件的方法10-25

    PHP使用遞歸算法無限遍歷數組示例05-20

    php遍歷數組的方法分享07-13

    PHP多維數組去掉重復值的方法08-04

    PHP 多維數組的排序問題10-23

    PHP遍歷目錄文件常用方法09-23

    c語言多維數組地址的表示方法07-31

    php數組操作方法10-18

    PHP 數組排序方法總結07-18

    <address id="ousso"></address>
    <form id="ousso"><track id="ousso"><big id="ousso"></big></track></form>
    1. 日日做夜狠狠爱欧美黑人