Comments are not used to perform any function in the program but are useful for developers. Developers can write comments with variables and functions to remember their working (purpose) in the program. One important thing to mention is that comments don’t have any impact on the execution of the program.
Page Contents
Types of Comments:
- Single Line comments
- Multi-Line comments
Single-Line Comments: –
These are used to add single-line comments with a variable or any function. There are two ways to write single-line comments using the // symbol or # symbol.
Example Program: –
<?php
// Single comment using // symbol
# Single comment using # symbol
echo "Welcome to Owlbuddy";
?>
Multi-Line Comments: –
These are used to add a multi-line comment with a variable or any function. /* */ symbols are used to add Multi-Line comments.
Example Program: –
<?php
/*
These multiline
comments also
use to hide
code.
*/
echo "Welcome to Owlbuddy";
?>
Parvesh Sandila is a results-driven tech professional with 8+ years of experience in web and mobile development, leadership, and emerging technologies.
After completing his Master’s in Computer Applications (MCA), he began his journey as a programming mentor, guiding 100+ students and helping them build strong foundations in coding. In 2019, he founded Owlbuddy.com, a platform dedicated to providing free, high-quality programming tutorials for aspiring developers.
He then transitioned into a full-time programmer, where his hands-on expertise and problem-solving skills led him to grow into a Team Lead and Technical Project Manager, successfully delivering scalable web and mobile solutions. Today, he works with advanced technologies such as AI systems, RAG architectures, and modern digital solutions, while also collaborating through a strategic partnership with Technobae (UK) to build next-generation products.
