Getting Started with PHP – Part 3 (Displaying Values)

Guest Posts Paolo Nikko Nuñal

The best thing about PHP is that it is not case-sensitive compared to other programming languages. PHP is a loose language and some functions and methods that you would normally write in other language are not followed in PHP.

Here's an example.

   echo "Hello World";
   ECHO "Hello World";
   EcHo "Hello World";

However, when declaring variables PHP is strict about it. Declaring variables start with a dollar sign "$". And can accept any types of values whether it is an object, string, float or integer. And as stated before.

$variable is not the same as $Variable.

Another thing you need to know is commenting in PHP. To comment PHP code you can do with a forward slash "//".

   //echo "I'm a comment";

To comment blocks, you can do with "/" and enclosed with a "/".

     /* Comment Block of Code
     echo "Hello world";
     echo "The quick brown fox jumps over the lazy dog";

Comments are useful for letting other programmers know what this line of code means as well as the learn how the code works or function most especially if you are planning on leaving the company and don't want to give a hard time for the new programmer to take in for the role for you.