nationalcoder
what is php

What is PHP? Run your first Program with PHP

What is PHP?

PHP is a Server Side Scripting Language. It is used to develop static websites, dynamic websites or web applications. PHP stands for Hypertext Preprocessor, which used to develop personal home pages.

PHP scripts can only be interpreted on a server where PHP is installed.

Accessing the PHP script requires only a web browser for the client computer.

In this tutorial you will learn-

  • What is a Scripting Language?
  • Differences between scripting and programming languages
  • What does PHP mean?
  • Basic PHP Syntax
  • Why PHP?
  • What is PHP used for and market share
  • First Program with PHP

What is a Scripting Language?

A scripting language is an interpreted programming language. It is translated into machine code when the code is run, rather than before. Scripting languages are often used for short text in full-fledged software programs. JavaScript, Python, and Ruby are all examples of scripting languages. All scripting languages are programming languages, but not all scripting languages are scripting languages.

PHP is a server side script that is interpreted on the server while JavaScript is an example of a client side script that is interpreted by the client browser. Both PHP and JavaScript can be embedded into HTML pages.

Differences between scripting and programming languages

 

Scripting Language Programming Language
Scripting languages are interpreter-based languages. Programming languages are compiler-based languages.
Scripting languages convert high-level instructions into machine language. The programming language helps to convert any program into machine language (at the same time).
Scripting languages don’t create any file types. Programming languages create .exe files.
It is easier and cheaper to maintain a scripting language. Maintaining a programming language is comparatively more expensive.

What does PHP mean?

PHP stands for – Personal Home Page, but now it’s a nickname for PHP: Hypertext Preprocessor.

PHP code can be embedded in HTML code, or it can be used in conjunction with various web templates, web content management systems, and web frameworks.

Basic PHP Syntax

PHP script starts with <?php and ends with ?>

PHP Syntax

Why PHP?

You’ve obviously heard of many programming languages out there; You may be wondering why we want to use PHP for web programming. Here are some interesting facts.

  • It’s open source (and therefore free!)
  • It’s easy to learn and use
  • Strong community support
  • It is well connected with databases
  • There’s lots of legacy code

What is PHP used for and market share

In terms of market share, there are more than 20 million websites and applications on the Internet that are developed using the PHP scripting language.

Need web developers to help you?

First Program with PHP

“Hello World!” It is the first program that most novice programmers will learn to write in any language. Here is an example of how to play “Hello World!” in PHP.

<?php
echo "Hello, World!";
?>
Output:
Hello, World!

It may also be useful to note that in most cases, echo Print can be used interchangeably. print returns a value, so it can be used to check if the print was successful, while echo assumes everything is working. In most cases, there is nothing we can do if the echo fails.

Leave a Comment

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

Scroll to Top