WeCodeAcademy

PHP Syntax and Comments

Statements end with a semicolon. Keywords and function names are not case-sensitive, but variable names are. Comments can use //, # or /* */.

ExamplePHP
<?php
// single-line comment
# also a single-line comment
/* multi-line
   comment */
echo "One\n";
ECHO "Keywords are not case-sensitive\n";
$color = "red";
echo "My car is " . $color . "\n";
echo "My car is $color\n";
Output
One
Keywords are not case-sensitive
My car is red
My car is red
Quick check

Which operator joins strings in PHP?

Finish the quick check (and any code exercise) to complete this lesson, or mark it done yourself.

Tip: use the left and right arrow keys to move between lessons.