Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <!DOCTYPE html>
- <html>
- <head lang="sr">
- <meta charset="UTF-8">
- <title>Manipulacija nizovima</title>
- <style>
- table {
- border: 1px solid black;
- }
- table th, td {
- padding-right: 30px;
- }
- </style>
- </head>
- <body>
- <h1>Rešenje zadatka<h1>
- <table>
- <tr>
- <th>id</th>
- <th>fname</th>
- <th>lname</th>
- <th>email</th>
- </tr>
- <?php
- $users = array(
- array("1", "Peter", "Andersen", "peter@gmail.com"),
- array("2", "John", "Miller", "john@gmail.com"),
- array("3", "Thomas", "Swift", "thomas@gmail.com")
- );
- printTable($users);
- function printTable($table) {
- $tableLen = count($table);
- for ($i = 0; $i < $tableLen; $i++) {
- echo "<tr>\n";
- for ($x = 0; $x < 4; $x++) {
- echo "<td>" . $table[$i][$x] . "</td>\n";
- };
- echo "</tr>\n";
- };
- };
- ?>
- </table>
- </body>
- </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement