The output I am trying to receive is "The Interest Rates are: 0.0525 0.0550 0.0575"
This will continue to $InterestRate7
value. I tried to link the new array elements with the old interest rate ($InterestRate1 = 0.0525; $RatesArray[1] = $InterestRate1)
but it still does not work for me.Here is my code for extra help.
<?php
$InterestRate1 = 0.0525;
$InterestRate2 = 0.0550;
$InterestRate3 = 0.0575;
$InterestRate4 = 0.0600;
$InterestRate5 = 0.0625;
$InterestRate6 = 0.0650;
$InterestRate7 = 0.0700;
$RatesArray = array(
$RatesArray[1] = "0.0525";
$RatesArray[2] = "0.0550";
$RatesArray[3] = "0.0575";
$RatesArray[4] = "0.0600";
$RatesArray[5] = "0.0625";
$RatesArray[6] = "0.0650";
$RatesArray[7] = "0.0700";);
echo $RatesArray[1];
?>
The array() construct doesn't work quite like what you have here. Try something similar to the example in the php documentation http://php.net/manual/en/language.types.array.php
$RatesArray = array(
1 => "0.0525",
2 => "0.0550",
3 => "0.0575");