A Beginners Guide to PHP(Hypertext Preprocessor): Part 1

A Beginners Guide to PHP(Hypertext Preprocessor): Part 1


TABLE OF CONTENT

  • Introduction

  • What is PHP

  • PHP Syntax

  • Frameworks developed from PHP

  • Relevance of this Programming Language

  • Conclusion

Introduction

There have been so many articles, and write-ups, talking about what PHP is and giving an insight into working with it, but I would like to come from a different perspective, especially for beginners, who want to understand PHP a little bit more.

I remember when I first started learning about 7 years ago, and in the training center, we were introduced to PHP, just after javascript had dealt with us, everything became very blurry, and learning became really hard, not an experience I want anyone to go through again, and so I decided to write about what I understand PHP to be and give a little starting point on soft ground for a beginner who wants to try out PHP.

What is PHP?

PHP as its full name is: Hypertext preprocessor, is simply an open-source scripting language used to build web applications, and dynamic web pages by being embedded into HTML.

So basically PHP is that gym bro that helps you achieve those muscles, in this case, a dynamic web application.

PHP Syntax

Let us take a look at the syntax of PHP in a simple format and then look at a complex PHP syntax.

For the simple format:

<?php echo "Hello World"; ?>

And Now for a complex syntax:

<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>A complex php code</title>
</head>
<body>
    <h1> Hello World</h1>

        <?php 
            $first = "Hello Olatunde";
            $second = "the greatest Ninja";

            echo $first;
            echo "<br>";
            echo $second
        ?>
</body>
</html>

You may notice some things being familiar like the HTML structure in the second example and see the PHP inside, yes that's correct php is amazing.

Frameworks developed from PHP

There are some frameworks created from PHP that help to build standard web applications and software, and these are in no particular order:

  • Laravel

  • Symfony

  • CakePHP

  • Codeigniter

  • Zend

Relevance of this Programming Language

  1. PHP is Versatile: what this means is php can literally run on any operating system, including mac, windows, and Linux.

  2. PHP is Very easy to work with Databases

  3. PHP has a very strong growing community that shares support.

  4. PHP developers are in high demand and therefore High pay.

Conclusion

So the conclusion for part 1 is, PHP is an easy-to-learn language as long as you are willing to be open-minded and it would give your tech career the boost it needs, also in the next part we would be setting up PHP on our PC, and getting the necessary software we need before running our application.