Skip to content

Instantly share code, notes, and snippets.

@praswicaksono
Last active January 24, 2018 15:16
Show Gist options
  • Save praswicaksono/3d1fa951be32ca080543d84a0c38086d to your computer and use it in GitHub Desktop.
Save praswicaksono/3d1fa951be32ca080543d84a0c38086d to your computer and use it in GitHub Desktop.
Iteration - Array
<?php
$pegawai = [
[
'nama' => 'Joni',
'umur' => 25,
],
[
'nama' => 'Ani',
'umur' => 21,
],
[
'nama' => 'Budi',
'umur' => 26,
],
];
foreach ($pegawai as $key => $value) {
echo 'Nama : ' . $value['nama'] . PHP_EOL .
'Umur : ' . $value['umur'] . PHP_EOL;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment