Before we begin, first confirm that, your server supports php ?
If yes, then every thing is fine.
If no, then install php by following this tutorial :-
www.php.net/manual/en/install.php
Lets Come to our Topic :-
[
Note:- In my whole lessons, I'll be using free hosting 3owl.com to execute php scripts.
]
Php scripts begins with <?php and ends with ?> just like in html, we use <html> to begin the script and </html> to end script.
A php file is a mixture of html tags and php script. We save it as xyz.php.
Here is a simple example, this will make you to understand it easily :-
In above example, <html>, <head>, <body> are html tags and
echo is used to print the output.
" " anything, which is inside the " " will be print as a message.
; and colon is used to end the statement.
Output of the above example will be
How to put Comments in PHP ?
In php, we can put One Line Comment by // < comment > and Comment Block /* < comments > */ (unlimited lines).
Example:-
I hope this post have helped you :p
Stay Tunned.
If yes, then every thing is fine.
If no, then install php by following this tutorial :-
www.php.net/manual/en/install.php
Lets Come to our Topic :-
[
Note:- In my whole lessons, I'll be using free hosting 3owl.com to execute php scripts.
]
Php scripts begins with <?php and ends with ?> just like in html, we use <html> to begin the script and </html> to end script.
A php file is a mixture of html tags and php script. We save it as xyz.php.
Here is a simple example, this will make you to understand it easily :-
<html><head><title>Lesson-2</title></head><body><?phpecho "Lesson 2 | Road to PHP";?></body></html>
In above example, <html>, <head>, <body> are html tags and
echo is used to print the output.
" " anything, which is inside the " " will be print as a message.
; and colon is used to end the statement.
Output of the above example will be
Lesson 2 | Road to PHP
How to put Comments in PHP ?
In php, we can put One Line Comment by // < comment > and Comment Block /* < comments > */ (unlimited lines).
Example:-
<html><head><title>Lesson-2</title></head><body><?php//This is one line comment/*This is oneblock comment*/?></body></html>
I hope this post have helped you :p
Stay Tunned.