if and array explanation
Posted: Tue Sep 12, 2006 12:53 am
I just really would like to know something:
I want to know what the following snippet of code is achieving, mainly this line because I get the rest:
Thanks
Code: Select all
<?
$package = $_REQUEST['package'];
$prices = array (
'basic' => 1500,
'professionalLite' => 2300,
'premiumProfessional' => 3500
);
if (isset ($_REQUEST['package'])) {
$answer = $prices[$package];
}
?>Code: Select all
$answer = $prices[$package];
}Thanks