Comments in PHP
In this tutorial we will learn about Comments in PHP. Comments are not used to perform any function in the program but they really useful for developers. Developers can write comments with variables and functions to remember their working (purpose) in the program. One important thing to mention comments doesn’t put any impact on the execution of program.
Types of Comments:
- Single Line comments
- Multi-Line comments
Single Line comments are used to add single line comment with a variable or any function. There are two ways to write single-line comments using // symbol or # symbol.
<?php // Single comment using // symbol # Single comment using # symbol echo "Welcome to Owlbuddy"; ?>
Multi-Line comments are used to add a multi-line comment with a variable or any function. /* */ symbols are used to add Multi-Line comments.
<?php /* These multiline comments also use to hide code. */ echo "Welcome to Owlbuddy"; ?>
Spread the love:
Please share this page on social media with your friends..