Get up to 80 % extra points for free! More info:

Discussion: Lesson 3 - Variables and type system in PHP

Back

 

Comments
Avatar
HENRY ABUA-ONUORAH:11/29/2016 18:06
very nice
but i tried this code and it is not working
 
Reply
11/29/2016 18:06
Avatar
Replies to HENRY ABUA-ONUORAH
David Capka Hartinger:11/30/2016 2:40

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.

Reply
11/30/2016 2:40
You can walk through a storm and feel the wind but you know you are not the wind.
Avatar
 
Reply
11/30/2016 15:30
Avatar
Sumit Kumar
Member
Avatar
Sumit Kumar:6/23/2017 2:15

echo is not function its a language construct.

 
Reply
6/23/2017 2:15
Avatar
Replies to Sumit Kumar
David Capka Hartinger:6/23/2017 3:35

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.

Reply
6/23/2017 3:35
You can walk through a storm and feel the wind but you know you are not the wind.
Avatar
Sumit Kumar
Member
Avatar
 
Reply
6/26/2017 3:48
To maintain the quality of discussion, we only allow registered members to comment. Sign in. If you're new, Sign up, it's free.

6 messages from 6 displayed.