1

A newbie to php but trying learn.
I thought it might be best to learn by trying to create small simple programs but I am getting the following error:

Parse error: syntax error, unexpected T_STRING in /home/jctest/www/www/mytest/mortgage.php on line 8

the code where the error seems to be is as follows:

<?php
// Set up variables
$month = 1;
$balance = 60834.09;
$payment = 573.81;
 
//Calculate interest 
function calcInterest() {                   <-----------[B] This is Line 8[/B]
$interest = ($balance x 6) / 100;
$balance = $balance + $interest;
echo $balance;
}
 
//Deduct Bi-weekly payment
Function calculate(){
$balance = $balance - $payment;
}
 
// Do calculation
calculate();
echo $balance . "<br>";
calcInterest();
echo $balance . "<br>";
?>

Any help appreciated.

Thanks

Votes + Comments
Thanks for noting the line where the error is.
2
Contributors
2
Replies
3
Views
10 Years
Discussion Span
Last Post by jcoones
0

Acutally, this is line 8:

$interest = ($balance x 6) / 100;

and you need to use * for multiplication instead of 'x'.

0

Yes of course. How stupid am I? :(

Thank you very much. Very much appreciated.

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.