What is PHP? Introduction to PHP

 

php

Introduction To PHP

{tocify} $title={Table of Contents}
  • PHP  is a server scripting language and a powerful tool for making dynamic and interactive web pages.
  • PHP stand for  “PHP: Hypertext Preprocessor“.
  • PHP file can contain text, HTML, CSS, JavaScript, and PHP code.
  • PHP file save on “.php” extension.
  • PHP is a widely-used, open source scripting language.
  • PHP scripts are execute on server.
  • PHP is free to download and use.
  • PHP can generate dynamic page content.
  • PHP can collect form data.
  • PHP can used to control user access.
  • PHP runs on various platforms (Windows, Linux, Mac OS etc.)

How PHP Works?

PHP site between your browser and the web server . When you type in the URL of PHP website in your browser, your browser sends a request to the web server. The web server then calls the php script on that page. The module executes the script which then sends the result in the front of HTML back to your browser which you seen on the screen.

Create and save a PHP file.

  • A php script is executed on the server, and the plane HTML result is send back to the browser.
  • A php script starts with <?php and ends with ?>

syntax:

<?php //write your php code hear. ?>

Example:


<!DOCTYPE html>
<html>
<head>
<title>PoorWebDev</title>
</head>
<body>
<?php
echo "hello world";
?>
<body>
<html>

PHP Echo and Print Statement:

They are both to output data the screen.

Echo

  • They simplest use of echo is to print a string as argument, for example
          echo ” Hello Word”;  OR  echo (“Hello Word”);

Print

  • The command print is very similar to echo, with two important differences:
  1. print can accept only one argument.
  2. print return a value, which represents whether the print statement succeeded.

       Example:

            print(“3.14”);  //print a string
            print(3.14);  //print a number

Related post

Top Websites that use PHP 

  1. Facebook
  2. Wikipedia
  3. Word
  4. slack
  5. Etsy
  6. Tumblr
  7. MailChimp

Tags: No tags

Add a Comment

Your email address will not be published. Required fields are marked *