Jamie Balfour

Welcome to my personal website.

Find out more about me, my personal projects, reviews, courses and much more here.

Part 2.2Comments in PHP

Part 2.2Comments in PHP

Comments in PHP

As with most programming languages (or maybe all programming languages), PHP supports comments.

PHP follows the traditional C style comments but it also adds a couple of non-C style ones too. There are a total of three different ways a comment can be opened in PHP:

  • #
  • //
  • /* */
PHP
<?php
	# Put our code here
	// Put our code here

	/*
	* This comment is
	* multiline
	*/
?>
					

The # and // comments are interchangeable whereas the /* and */ combination is the multiline comment.

Feedback 👍
Comments are sent via email to me.