I'm trying to figure out a way to convert celsius to fahrenheit using php. Here's my code so far. It keeps saying I have a unexpected '{' on line 12.
<html>
<body>
<?php
for ($num=10, $num1=$num, $max=100; $num <= $max; $num++)
{
if ((($num % 10) == 0))
{
echo $num;
echo ( " converted to fahrenheit is " );
}
elseif ((5/9) * ($num1 - 32)
{
echo $num1;
echo ( "</br>" );
}
}
echo ( "</br> End Loop." );
?>
</body>
</html>
I'm a beginner. Just trying to get a grasp on php. Any help will be appreciated.
EDIT: It's supposed to convert every number divisble by 10 (e.g. 10, 20, 30, 40...) from Celsius to Fahrenheit.
The specific error you're getting is because this:
Needs to be:
(Missing closing paren)
I think your entire script could be rewritten like this:
Working example: http://3v4l.org/iT7p0