Maison  >  Questions et réponses  >  le corps du texte

Comment parcourir deux ou plusieurs tableaux en php ou jq, chaque tableau comporte deux éléments, comme indiqué ci-dessous

Par exemple : $a = [A,B] $b = [C,D]

Comment boucler en tant que $array=array(

​​​ ​​​​array(A,D)​,

                                              tableau (B,                                                                                                                                                                                                      tableau         ! ! La méthode qui n'est pas codée en dur peut être constituée de plusieurs tableaux. Les spécifications du produit d'arrière-plan sont les suivantes. Js et php peuvent être utilisés

.
何惜一博何惜一博2134 Il y a quelques jours1091

répondre à tous(3)je répondrai

  • 唯一

    唯一2018-11-20 10:00:14

    Spécifications multiples

    répondre
    0
  • PHP

    PHP2018-11-16 17:57:40

    <?php

    $arr = array();

    foreach($a comme $key=>$value){

        foreach($b comme $key1=>$value1){

            $arrSon [] = $value;

            $arrSon[] = $value1;

            $arrSon[] =    $arrSon;

            unset($arrSon);

        }

    }

    e cho "<pré/ >";

    print_r($arr);

    ?>

    希望有用

    répondre
    0
  • 何惜一博

    Frère, que se passe-t-il s'il y a trois ou quatre groupes, comme $a = [A,B] $b = [C,D] $c = [E,F] $tableau=tableau( tableau(A,C,E) , tableau(A,C,F) , tableau(A,D,E) , tableau(A,D,F) , ..... tableau (B, D, F) ) La boucle atteint sa fin, y a-t-il un moyen, mon frère ?

    何惜一博 · 2018-11-16 18:03:59
  • Annulerrépondre