Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- $names = [
- "Andi","Anita",
- "Beni","Bintang",
- "Cika","Chandra"
- ];
- ?>
- <html lang="en">
- <head>
- <title>PHP - foreach</title>
- </head>
- <body>
- <?php foreach($names as $name):?>
- <h1>
- <?php echo $name;?>
- </h1>
- <?php endforeach;?>
- </body>
- </html>
Advertisement
Add Comment
Please, Sign In to add comment