Discussion – Lesson 3 - Variables and type system in PHP
BackComments

Member

6 messages from 6 displayed.
//= Settings::TRACKING_CODE_B ?> //= Settings::TRACKING_CODE ?>
Comments
Your HTML code is not valid. You opened the HTML head and didn't close it. You also lack the HTML body. In PHP code, you miss a semicolon right after the $age variable initialization.
I've corrected it for you:
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="content-type" content="text/html, charset=UTF-8">
<title></title>
</head>
<body>
<?php
$age=20;
$sentence="Hello,I'm ";
echo($sentence.$age." years old.");
?>
</body>
</html>
Since you use only Notepad, it looks like you didn't read the previous article. Install the NetBeans IDE instead, see https://www.ict.social/…aking-an-app.
A good course won't bother you with such terms from the start. We can safely state that it's a function and there's no problem with that because there are only a few constructs in PHP which behave exactly the same as functions. The only difference is that you can omit parentheses.
6 messages from 6 displayed.