Sunday, May 10, 2020

WHAT IS PHP?

o  PHP (Hypertext preprocessor) is a widely-used open-source server-side scripting language.
o  PHP specially used for website development.
o  It was originally created by Rasmus Lerdorf in 1994.

WHY PHP IS IMPORTANT?
o  PHP is easy to learn especially for beginner.
o  PHP can be downloaded and use freely.
o  PHP can run almost platforms (Window, Linux, Unix, Mac OS, etc.)
o  PHP supports a wide range of databases.

WHY YOU SHOULD LEARN PHP?
o  PHP is very easy to start for beginners.
o  Wide community supports available online.
o  PHP can securely process the databases.
o  You can make dynamic webpages.
What Can PHP Do?
  • PHP can generate dynamic page content
  • PHP can create, open, read, write, delete, and close files on the server.
  • PHP can collect form data
  • PHP can send and receive cookies
  • PHP can add, delete, modify data in your database
  • PHP can be used to control user-access

The first step towards PHP

What should you know and need?
o  You must have basic knowledge about Html, CSS and JavaScript.

How to install PHP and Start?
o  Download XAMPP and WAMP server on your PC.
o  Install it on your computer it automatically installs PHP, MySQL, PhpMyAdmin and Apache.
o  Download any text editor like Sublime text, Dreamweaver and notepad++ to write scripts <!DOCTYPE html>

Run your first Program

    Open any text editor and write down some code.
<html>
    <head>
        <title>Example</title>
    </head>
    <body>

        <?php
            echo "Hi, I'm a first PHP script!";
        ?>

    </body>
</html>

o   Save this file inside Htdocs folder with .php extension.
o   Run this program on your browser and you will see the results.

Syntax
o   PHP always start with <?php and ends with?> tag.
o   Always give extension .php when you are going to save.
o   You need to write your code under HTML body tag.