Saturday, July 22, 2017

Introduction to PHP



The PHP Hypertext Preprocessor (PHP) is a programming language that allows web developers to create dynamic content that interacts with databases. PHP is basically used for developing web based software applications.




What is PHP?

1. PHP (recursive acronym for PHP: Hypertext Preprocessor) is a widely-used open source general-purpose scripting language that is especially suited for web development and can be embedded into HTML.
2. PHP is an interpreted language, i.e. there is no need for compilation.
3. PHP is faster than other scripting language e.g. Asp,Servlet,Jsp etc

What can PHP do?

PHP is mainly focused on server-side scripting, so you can do anything any other CGI program can do, such as collect form data, generate dynamic page content, or send and receive cookies. But PHP can do much more.

There are three main areas where PHP scripts are used.
  • Server-side scripting : This is the most traditional and main target field for PHP. You need three things to make this work: the PHP parser (CGI or server module), a web server and a web browser. You need to run the web server, with a connected PHP installation. You can access the PHP program output with a web browser, viewing the PHP page through the server. 
  • Command line scripting : You can make a PHP script to run it without any server or browser. You only need the PHP parser to use it this way.
  • Writing desktop applications : PHP is probably not the very best language to create a desktop application with a graphical user interface, but if you know PHP very well, and would like to use some advanced PHP features in your client-side applications you can also use PHP-GTK to write such programs. (http://gtk.php.net/)


Sample php code to display text in webpage.

<?php

echo "welcome to skptricks"

?>



            




No comments:

Post a Comment