Created
May 30, 2012 08:49
-
-
Save eimg/2834640 to your computer and use it in GitHub Desktop.
Template style with PHP short open tags.
This file contains 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 | |
$countries = array( | |
array('iso'=>'AS', 'name'=>'American Samoa', 'iso3'=>'ASM'), | |
array('iso'=>'AD', 'name'=>'Andorra', 'iso3'=>'AND'), | |
array('iso'=>'AO', 'name'=>'Angola', 'iso3'=>'AGO'), | |
array('iso'=>'AG', 'name'=>'Antigua and Barbuda', 'iso3'=>'ATG'), | |
array('iso'=>'AR', 'name'=>'Argentina', 'iso3'=>'ARG'), | |
array('iso'=>'AM', 'name'=>'Armenia', 'iso3'=>'ARM'), | |
array('iso'=>'AT', 'name'=>'Austria', 'iso3'=>'AUT'), | |
array('iso'=>'AZ', 'name'=>'Azerbaijan', 'iso3'=>'AZE'), | |
array('iso'=>'BS', 'name'=>'Bahamas', 'iso3'=>'BHS'), | |
array('iso'=>'BH', 'name'=>'Bahrain', 'iso3'=>'BHR'), | |
array('iso'=>'BD', 'name'=>'Bangladesh', 'iso3'=>'BGD'), | |
array('iso'=>'BB', 'name'=>'Barbados', 'iso3'=>'BRB') | |
); | |
?> | |
<!DOCTYPE HTML> | |
<html lang="en-US"> | |
<head> | |
<meta charset="UTF-8"> | |
<title>PHP Template</title> | |
</head> | |
<body> | |
<h1>Countries</h1> | |
<table> | |
<tr> | |
<th>ISO</th> | |
<th>Country Name</th> | |
<th>ISO 3</th> | |
</tr> | |
<? foreach($countries as $country): ?> | |
<tr> | |
<td class="highlight"><?= $country['iso'] ?></td> | |
<td><a href="#"><?= $country['name'] ?></a></td> | |
<td><?= $country['iso3'] ?></td> | |
</tr> | |
<? endforeach; ?> | |
</table> | |
</body> | |
</html> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment