PHP Lesson 1: Getting started


The purpose of this lesson is to familiarize you with PHP and its latest version availability. We have designed this tutorial for novices in order to provide a solid platform for the basic knowledge of PHP application development which will assist you in learning more advanced PHP techniques in our upcoming lessons. While prior programming experience is not necessary, experience working with any of the traditional programming languages will make it easier for you to learn PHP code.

PHP stands for Hypertext Pre-processor and is a widely-used open source platform in the web development industry. In terms of utility and scope of development, PHP is a very dynamic coding platform which is not only well-known as a web development language, but as a general purpose development language and a command line scripting tool. It is a server side scripting language and embedded with HTML. At present PHP 5.6.2 is the most current and stable version which is available to practice your code, however there is no problem learning to develop PHP with any of the previous versions.

Versions after PHP3 support ”Object Oriented Programming” which is also known as ”OOPS”. Learning PHP will teach you the basics of working with OOPS as well as defining your project requirements with UML (Unified Modeling Language. UML can help you define your project in a well-organized manner from the start, ensuring the outcome is what your client or project manager expects it to be. OOPS and UML are not limited to PHP only, so you can also use these development techniques in other traditional high-level languages. It is assumed that basic programmers using this PHP lesson likely have a basic idea of HTML codes, the OOPS concept, and UML.

PHP is an ideal choice for website development projects that require server side interaction. Server side scripting means that PHP code is executed on the server instead of on the user’s computer. A prime demonstration of this is interaction with a database, for this example we’ll use a login. The user inputs data which is sent to the server for processing. Once the data is processed, the server generates data to return to the user creating a dynamic web page.

PHP is widely being used with Rational DBMS. The rapid development of PHP based framework has provided a wider opportunity for programmers to design specific building blocks and structures in order to minimize efforts in rewriting code. In addition to that, it has provided built-in classes and functions readily available in the PHP library. To name a few you can look out for Symphony, CakePHP, Zend, CodeIgniter, Yii and PRADO, which are some of the most popular PHP framework to write specific web application.

Being an open-source and free software platform, PHP has a large community offering various free and open-source libraries. Numbers of functions and classes similar to C language are found available in PHP builds. You have the liberty to write your own extensions, which are typically written in C, to add that specific functionality in the PHP library, and it can be redistributed and used by the community to build the same functional code. The community provides free-of-charge complete source code which you can rebuild, customize and extend for your own development usage. You can also get help from PECL which is PHP Extension Community Library project, providing a large repository of PHP extensions.

Now let’s make you familiar with code snippets of PHP. PHP code is written with a special start and end tag “” respectively, which process instructions to enter in and out of PHP mode. Look at the code illustration below to see how the PHP code is embedded in HTML syntax:

The above code would let you know basic PHP code structure and output string – ‘echo “”’ which will displaying the text: “This is PHP Mode stating start and end tag.” It simply returns pure HTML result in form of outcome. Here is to understand that PHP interpreter would executes the PHP line written only within the delimiters and anything beyond the delimiters would be simply ignored. You can understand that PHP code can be used to perform various tasks from evaluation of data captures from browser, building application to serve interactive contents on browser and can send and receive cookies. You can also perform system-level functionalities; build form-based functionalities to capture huge number of data and even create constraints for users to have limited access to application.

You can also use following delimiters which are recognized by PHP parser.

The is most commonly used delimiter among programmers and we shall also keep using same tag in our all upcoming tutorials.

PHP is used with a number of widely known database tools like MySQL, Oracle, Informix, Sybase and MSSQL server to draw database driven solution in dynamic environment. N-tier development with PHP makes it the most feasible and adapted programming language which supports distributed object architecture including CORBA and COM as well as it supports JAVA. It also supports numerous protocols such as LDAP, IMPA and POP3.

Our upcoming lessons will focus on technicality and coding structure being used in PHP. We shall let you familiar with LAMP and WAMP as PHP environment to setup on your local machine to run PHP code. We shall then learn about classes, functions, data types, objects and almost all programming concepts being used with PHP to master the skill of coding. You can make yourself well familiar with HTML codes and syntax to be used with HTML forms would make your learning experience with PHP more fruitful.

Leave a Reply