ujiajah1

php foreach

Aug 20th, 2016
64
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.52 KB | None | 0 0
  1. <html>
  2.   <head>
  3.     <link rel="stylesheet" href="stylesheet.css" />
  4.     <title>Codecademy Languages</title>
  5.   </head>
  6.   <body>
  7.     <h1>Languages you can learn on Codecademy:</h1>
  8.     <div class="wrapper">
  9.       <ul>
  10.         <?php
  11.           $langs = array("JavaScript",
  12.           "HTML/CSS", "PHP",
  13.           "Python", "Ruby");
  14.        
  15.           foreach ($langs as $lang) {
  16.               echo "<li>$lang</li>";
  17.           }
  18.        
  19.           unset($lang);
  20.         ?>
  21.       </ul>
  22.     </div>
  23.   </body>
  24. </html>
Add Comment
Please, Sign In to add comment