PHP comment is not read/executed as part of the program. Its only purpose is to be read by someone who is looking at the code.
To do a single line comment type “//” or “#” and all text to the right will be ignored by PHP interpreter.
1 |
<!DOCTYPE html><html><body><?php// single-line comment# Also a single-line comment/*Multiple-lines comment blockthat spans over multiplelines*/// You can also use comments to leave out parts of a code line$x = 15 /* + 15 */ + 15;echo $x;?></body></html><strong>output-</strong> 15 |