Created
May 30, 2011 19:41
-
-
Save kwilczynski/999369 to your computer and use it in GitHub Desktop.
Example PHP ...
This file contains hidden or 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 | |
$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