Mar
17

Welcome to the world of PHP. PHP is short for PHP Hypertext Processor. It is currently one of the most powerful dynamic scripting language that can adapt to new technologies such as AJAX and Flash. Also, PHP is an open-source programming language, which means that its library can grow wider with the development of different modules.

Let’s start PHP programming.

All basic PHP files start with .php extension. Apart from that, all PHP files start with <?php and end with ?>.

Now, let’s go on with the real stuff.

Majority of PHP files are categorized into two namely: strings and variables. Strings comprise of constants, which are embedded in the website for as long as you change it manually. Variables on the other hand have stored values, often transferred by sessions, cookies, and other related methods.

Take this example:

<?php
$user = "Javie";
print "Hello username";
print "Hello $user";
?>

As you see above, the first string’s user name cannot be changed because it is constant. The next string is more flexible as the user name is set to Javie.

TASK:                                                                   

Since I have no time left, I’ll leave you with a task.

Create a program in your WordPress that creates a sentence mostly from variables only.

:)