You are here: Home / Topics / Introduction to PHP Language

Introduction to PHP Language

Filed under: PHP on 2023-03-14 06:40:00

PHP language stands for “PHP: Hypertext Pre-processor”

The most widely-used, open-source, and script language. All PHP scripts are executed on the server.

 

It can be run on different platforms like:

  • Windows
  • Linux
  • Unix
  • Mac OS X etc.

It is used for almost every server like

Apache 


It also supports various types of databases.
 

PHP Syntax
 

PHP script starts with

        <?php

        Code written here…

        ?>

The extension for PHP files is “.php”. Normally a PHP FILE contains HTML tags, and some PHP scripting code. Below, there is an example of a code, with a PHP script that uses a built-in PHP function “echo” for print out the text “Script Language” on a web page:

Example 

 

<!DOCTYPE html>
<html>
<body>
<h2>PHP Page</h2>
<?php
echo "Script Language";
?>
</body>
</html>
 

Output

               PHP Page

          Script Language
 

Code Comments
<html>Starting with HTML tags
<h2></h2>Head (heading 2)opening and closing of head
<?phpStarting php
echoBuilt in function to print the text
 ?>Closing of php


Pre-requisites to PHP
 

Before you start your learning with PHP, you must have a little basic understanding of HTML, CSS, and JavaScript.

About Author:
T
Team MCQ Buddy     View Profile
Hi, I am using MCQ Buddy. I love to share content on this website.