Update Terbaru
Loading...
Sunday 15 December 2013

PHP

In this part of the PHP tutorial, we will talk about the PHP programming language in general.

Goal

The goal of this tutorial is to get you started with the PHP programming language. The tutorial covers the core of the PHP language. Variables, arrays, control structures and other core features. It does not cover web development, databases or other numerous topics. In this tutorial, we will cover PHP 5.

PHP

PHP is a scripting language designed for web development. It is used to produce dynamic web pages. Currently, PHP is one of the most widely used programming languages. Much of its syntax is borrowed from C, Java and Perl with a couple of unique PHP-specific features. PHP can be embedded into HTML code and it generally runs on a web server. The web server needs to be configured to process PHP code and create web page content from it. It can be deployed on most web servers and operating systems. PHP is a free software. PHP was first created in 1995 and is actively developed since then. As of this writing, the newest version is PHP 5.3.1.
PHP supports both object oriented and procedural programming styles.
The official web site for the PHP programming language is php.net

Programming languages

There are currently several widely used programming languages. The following list is based on the TIOBE Programming Community Index. The numbers are from December 2009. Note that these figures are only illustrative. No one knows the exact numbers.
Position Language Ratings
1Java17%
2C16.3%
3PHP9.8%
4C++9.2%
5Visual Basic7.8%
6C#6.3%
7Python5.2%
8Javascript3.5%
9PERL2.69%
10Ruby2.65%
Java is the most widely used programming language. Java excels in creating portable mobile applications, programming various appliances and in creating enterprise applications. Every fourth application is programmed in C/C++. They are mainly used for creating operating systems and various desktop applications. C/C++ are the most widely used system programming languages. Most famous desktop applications were created in C++. May it be MS Office, Macromedia Flash, Adobe Photoshop or 3D Max. These two languages also dominate the game programming business.
PHP dominates over the Web. While Java is used mainly by large organizations, PHP is used by smaller companies and individuals.
Visual Basic represents the popularity of rapid application development and the dominance of Microsoft.
The C# was planned to be the next big language. It should compete mainly with Java and C/C++ languages.
Python, PERL and Ruby are the most widely used scripting languages. They share many similarities. They are close competitors.

PHP CLI

PHP CLI is a command line interpreter for the PHP language. It is useful for testing PHP scripts from the shell. In this tutorial, we will be using the PHP command line interpreter. This way we will focus on the core of the PHP language.
There is a php5-cli module which we have to install in order to run PHP on the command line.
<?php

echo "this is PHP language\n";

?>
Here we have a simple PHP script.
$ php simple.php
this is PHP language
We execute the script.

Interactive shell

Like Python or Ruby, PHP also has an interactive shell. It is useful to test small language constructs.
$ php -a
Interactive shell

php > print PHP_OS;
Linux
The PHP shell is invoked with the -a option of the php command. The shell uses the php > prompt.

References

In this part of the PHP tutorial, we have introduced the PHP language.

0 comments:

Post a Comment

About Us

Powered by Blogger.
Copyright © 2013 Zuhzwan All Right Reserved