Introduction of PHP

PHP stands for HyperText Preprocessor. It is a powerful and widely-used open source server-side scripting language. It’s used for creating dynamic web pages. It can be embedded into HTML. It is faster than other scripting language e.g. asp and jsp. PHP is simple and easy to learn language. It most popular scripting language.

Syntax :-
<?php
?>

A PHP script starts with the <?php  script  ends with the ?> tag.

Embedding PHP within HTML:-

PHP files are plain text files with .php extension. Inside a PHP file you can write HTML like you do in regular HTML pages as well as embed PHP codes for server side execution.

PHP Example:-

File: first.php

<!DOCTYPE HTML>
<html>
<head>
<title>Example</title>
</head>
<body>
<?php
echo "Hi, I'm a PHP script!";
?>
</body>
</html>

Output :-

Hi, I'm a PHP script!

 

Leave a Reply

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