Please note, this is a STATIC archive of website www.tutorialspoint.com from 11 May 2019, cach3.com does not collect or store any user information, there is no "phishing" involved.
Tutorialspoint

rnd1

<html>
   <body>
      
      <?php
         $myArray['a1'] = 1;
         $myArray['a2'] = 2;
         $myArray['b1'] = 3;
         $myArray['b2'] = 4;
         $startKey[0] = 'a';
         $startKey[1] = 'b';
         
         for( $i = 1; $i<3; $i++ ) {
            for( $j = 0; $j<2; $j++ ) {
                echo $myArray[$startKey[$j] . $i];
            }
         }
         echo '<br>';
         for( $i = 0; $i<2; $i++ ) {
            for( $j = 1; $j<3; $j++ ) {
                echo $myArray[$startKey[$i] . $j];
            }
         }
      ?>
   
   </body>
</html>

Advertisements
Loading...

We use cookies to provide and improve our services. By using our site, you consent to our Cookies Policy.