SHARE
TWEET

Untitled

a guest Jul 17th, 2019 62 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. <?php
  2.     $arrNilai = array ("Ani" => 80, "Otim" => 90, "Ana" => 75,"Budi" => 85);
  3.     echo "Menampilkan isi array dengan foreach : <br>";
  4.    
  5.     foreach ($arrNilai as $nama => $nilai) {
  6.      echo "Nilai $nama = $nilai<br>";
  7.     }
  8.     reset ($arrNilai);
  9.     echo "<br>Menampilkan isi array dengan while dan list : <br>";
  10.    
  11.     while (list ($nama, $nilai) = each($arrNilai)) {
  12.      echo "Nilai $nama = $nilai<br>";
  13.     }
  14. ?>
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top