Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- $file = "data.txt";
- $raw = file_get_contents($file);
- $baris = explode("|R|", $raw);
- ?>
- <table style="border:1px solid #333;">
- <thead>
- <th style="border-bottom:1px solid #333">Nama</th>
- <th style="border-bottom:1px solid #333">Email</th>
- <th style="border-bottom:1px solid #333">Telp</th>
- <th> </th>
- </thead>
- <tbody>
- <?php
- for($i = 0; $i < count($baris); $i++) {
- $barisKeI = $baris[$i];
- $koloms = explode("|F|", $barisKeI);
- //var_dump($koloms);
- if(count($koloms) != 3) continue;
- echo "<tr>";
- echo "<td>".$koloms[0]."</td>";
- echo "<td>".$koloms[1]."</td>";
- echo "<td>".$koloms[2]."</td>";
- echo '<td><a href="phonebook.php?row='.$i.'">Edit</a></td>';
- echo '<td><a href="hapus.php?row='.$i.'">Delete</a></td>';
- echo "</tr>";
- }
- ?>
- </tbody>
- </table>
- <?php
- //echo "<pre>"; // preformatted
- //print_r($baris);
- //echo "</pre>";
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement