Jump to content

Newbie: Parse error: syntax error, unexpected T_STRING, expecting ',' or ';'


Cristian

Recommended Posts

Hello everyone. I am new here and I just started learning PHP; I apologize in advance for how stupid this question will seem to most of you I'm sure. I'm following a video guide and typing what the instructor says (I've checked it like 10 times) but for some reason he isn't getting an error and I am.

 

I am just trying to do simple arithmetic.

<html>
<head>
	<title>Numbers - Christopher</title>
</head>
<body>
	<?php
		$var1 = 3;
		$var2 = 4;
	?>

	Basic Math: <?php echo ((1 + 2 + $var1) * $var2) / 2 – 5; ?><br />

</body>
</html>

 

The answer that comes up on his screen is 7. On mine, it says this:

Parse error: syntax error, unexpected T_STRING, expecting ',' or ';' in C:\wamp\www\christopher\numbers.php on line 11. I'm sure there is something stupid that I am missing. Anyone care to help out the newbie :)?

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.