Skip to content

Instantly share code, notes, and snippets.

@itskingori
Created December 20, 2013 06:53
Show Gist options
  • Save itskingori/8051294 to your computer and use it in GitHub Desktop.
Save itskingori/8051294 to your computer and use it in GitHub Desktop.
Creating Arrays
<!DOCTYPE html>
<html>
<head>
<title>Exercise 04: Creating Arrays</title>
</head>
<body>
<?php
// Create array that holds all the provinces of Kenya and output them to the
// browser from top to bottom
// Create the array
$province[1] = "Central";
$province[2] = "Coast";
$province[3] = "Eastern";
$province[4] = "North Eastern";
$province[5] = "Nairobi";
$province[6] = "Nyanza";
$province[7] = "Rift Valley";
$province[8] = "Western";
// Output the array
echo "<pre>";
print_r($province);
echo "</pre>";
?>
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment