Skip to content

Instantly share code, notes, and snippets.

@kwilczynski
Created May 30, 2011 19:41
Show Gist options
  • Save kwilczynski/999369 to your computer and use it in GitHub Desktop.
Save kwilczynski/999369 to your computer and use it in GitHub Desktop.
Example PHP ...
<?php
$customers = array('hennie' => 100, 'krzysztof' => 10);
$customer = $_GET['customer'];
if (! $customer)
{
echo 'You have to specify a customer name in order to access its balance details';
exit(1);
}
if (array_key_exists($customer, $customers))
{
echo 'Customer ' . $customer . ' has balance: ' . $customers[$customer];
}
else
{
echo 'No such customer: ' . $customer;
}
?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment