PHP - Introduction to PHP & Syntax

PHP is the recursive acronym that probably means to confuse the masses. PHP stands for Hypertext Preprocessor which allows your website to be dynamic.

PHP is the recursive acronym that probably means to confuse the masses. PHP stands for Hypertext Preprocessor which allows your website to be dynamic.

PHP is completely server-side scripting language. PHP is very flexible and easy to learn those who have knowledge of programming languages like (C, Java, Perl), it will be very easy to learn so.

If you don't have the knowledge of C or Java it will be a little bit  difficult but not impossible to learn so you don't have to worry about PHP. PHP is mostly used to enhance web pages, with PHP you can make login forms you can create username and password you can check details from a form, create forums and many more things. 

PHP is embedded with HTML. PHP has compatibility to connect with databases through MYSQL or any Database Management Software. You can create a database, tables and you fetch data from the database and you can display those data's in own way. PHP's popularly continues to increase as business and individuals everywhere embrace it as an alternative to Microsoft's ASP.NET language. According to Netcraft, PHP Code can be found running on approximately 21 million websites.

What You Need?  

Before we start, you need to install few things to run your PHP script on your computer. Without these resources, you cannot run PHP script. 
  1. First of all, you need to install server on your computer to run PHP script locally. The server means Apache server. You can install apache officially through www.apache.org or you can download wampp application from www.wampserver.com, If still you can't find better then you can use one of the popular application called XAMPP, inside xampp you can find Apache Server, MySQL, Filezilla, Tomcat, Mercury servers. 
  2. If you are on MAC then visit www.mamp.info and you will get application and download and install on your MAC. 
PHP allow your script to collect users information, It means, you can let your user directly interact with the script.

PHP Syntax

PHP code is dented in the page with opening and closing tags, as follows, 

<?php
. //code goes here
. //comment ignored
. /*ignored automatically*/
?>

PHP CODE


<html>
<head>
<title>My First PHP Code</title>
</head> <body>
<?php
echo "HELLO WORLD ! ";
echo "<p>PHP SCRIPT IS RUNNING SUCCESSFULLY</p>";
echo "<i>DO ECHO TO GET STRING OUTPUT</i>";
echo "&nbsp;<b>THE MOST POPULAR SCRIPTING LANGUAGE IS PHP</b>";
echo "&nbsp;<u>THANKS FOR LOVING PHP _ :D </u>";
?>
</body>
</html>

OUTPUT

Hypertext Preprocessor
Hypertext Preprocessor : LOCALHOST/FILENAME.PHP

You May Also Like...