php examples for beginners

Basic PHP tutorial for beginners with examples

PHP (Hypertext Preprocessor) is very excellent and Popular Scripting Language. It is used to create Dynamic website or web pages and it runs on Server Side.

PHP is an Open Source programming language and free to use. It is easily integrated with HTML. You have Basic knowledge about HTML, CSS and JAVA-SCRIPT so you can easily edit and customize code.

For executing PHP Code you must have a Local Server like WAMP Server or XAMPP Server in your Computer. PHP file always save with .php extension.

PHP Supports on Various Platforms like Windows, Mac OS, Linux, Unix and it is integrated with Databases like MYSQL, Microsoft SQL Server, Oracle.

Basics of PHP :

PHP code strat and ends with

 <?php ... ?> 

with this syntax.

For Example :


<?php
	//Your code here
?>

Two types of PHP Comments.

(1) Single line Comment

(2) Multi line Comment

For Example :


<?php
	//single line comment

	/* 
	  multiple line comment
	*/
?>

PHP can performs some system functions like create, read, write, open, delete on server side.

PHP handle form action like Collecting Data, Send Data and Display Data.

You can Add, Edit, Delete, Update Data in Database.

Basic PHP file contains HTML, CSS, JAVASCRIPT and PHP code.

PHP EXAMPLE :


<!DOCTYPE html>
<html>
<head>
<title>Welcome To PHP Demo Example</title>
</head>
<body>

<?php
echo "PHP Demo Example";
?> 

</body>
</html>

OUTPUT :

php tutorials with examples

Above example is very basic and we put PHP example with Source Code and It’s output. We use “echo” to print or display text “PHP Demo Example”.

Leave a Reply