Last active
August 29, 2015 14:02
-
-
Save hSammir/8e0ae188514a90a5527c to your computer and use it in GitHub Desktop.
Menampilkan daftar berita plus gambar *hanya* untuk list berita ter atas.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php | |
| /* | |
| Asumsikan database: | |
| | Judul Berita | Kutipan berita | Gambar | | |
| */ | |
| $data = [ | |
| [ | |
| 'jb' => 'Workshop Pengenalan Drupal', | |
| 'kb' => 'Workshop \"Mengenal Drupal\" yang dilaksanakan oleh UKM IT \"Cybernetix\" ', | |
| 'gb' => 'http://cybernetix.or.id/sites/default/files/styles/konten/public/workshop-drupal1_0.jpg' | |
| ], | |
| [ | |
| 'jb' => 'Musyawarah Besar VI', | |
| 'kb' => 'Musyawarah Besar UKM IT Cybernetix VI ', | |
| 'gb' => 'http://cybernetix.or.id/sites/default/files/styles/block_kegiatan/public/mubes.jpg' | |
| ], | |
| [ | |
| 'jb' => 'Latihan Dasar Kepemimpinan Mahasiswa I', | |
| 'kb' => 'Pelatihan dasar tentang segala hal yang berkaitan dengan kepemimpinan', | |
| 'gb' => 'http://cybernetix.or.id/sites/default/files/styles/block_kegiatan/public/ldkm-1.jpg?itok=uAWeAXGr' | |
| ] | |
| ]; | |
| $i = -1; | |
| foreach ($data as $datum) { | |
| $i++; | |
| if($i==0){ | |
| echo "<img src='".$datum['gb']."'<br/>".$datum['jb']."<br/><hr>"; | |
| }else{ | |
| echo "$datum[jb]<br/><hr>"; | |
| } | |
| } | |
| ?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment