PHP TutorialWhat is PHP Environment Setup of PHP PHP Syntax PHP Comments PHP Echo & print PHP Variables PHP Scope Variables PHP $ and $$ Variable PHP Constants PHP Operators PHP Data Types
PHP Conditional Statements
PHP Loop Type
PHP ArraysPHP String PHP Functions
PHP FormsForm Intro Get & Post Form Validation / Required Complete Form
PHP AdvancedPHP Include PHP Date & Time PHP Session PHP Cookies PHP File Handling PHP Open File PHP Read File PHP Write File PHP Append File PHP Delete File PHP File Upload PHP Sending Mail PHP Error Handling
In PHP, comments are sections of code that are not executed when a program is run. It's only purpose to help the progarmmers to understand the code.
For example, when a developer is open a PHP file for the first time, so they can easily understand the php code they are looking at. And It also helps the other programmers why we wrote this code.
In PHP, two ways of commenting
- Single Line
- Multiple Lines
Single Line Comment:
It is used to explain a single line of code. we can use two symbles for comment a single line of code ( # and // ).
- # - hash tag
- // - double forward slashes
<!DOCTYPE html> <html> <body> <?php # This is my first comment // This is another way to enter single line comment ?> echo "Hello World"; //comment - why we are using this line </body> </html>
Multiple Lines Comments:
It is allow to comments multiples lines in PHP code.
Syntax: comment start with /* and end with */.
<!DOCTYPE html> <html> <body> <?php /* This is the way of comment multiple-lines in PHP Code */ echo "Hello World"; ?> </body> </html>
SEARCH POST HERE
Subscribe My YouTube Channel
Join Our Telegram Channel & Support Eachother
Elevenstech Web Tutorials
Elevenstech Web Tutorials helps you learn coding skills and enhance your skills you want.
As part of Elevenstech's Blog, Elevenstech Web Tutorials contributes to our mission of “helping people learn coding online”.
Subscribe to get the latest updates from Elevenstech Web Tutorials and stay up to date