Basics of PHP Programming
PHP is a powerful tool for making dynamic and interactive Web pages. Php stands for pre hypertext programming language or hypertext preprocessor. It is a server site programming language like other programming language like Asp.net etc. PHP is the widely-used, free, and efficient alternative to competitors such as Microsoft’s ASP.
When creating PHP pages, you can use the same program you use to create your HTML pages. Any plain text editor will do. You will also need an FTP client to transfer files from your computer to your web hosting. If you already have an HTML website you most likely already use an FTP program.
PHP generally runs on a web server, taking PHP code as its input and creating Web pages as output, however you can also use it for command-line scripting and client-side GUI applications. PHP is an extremely versatile language which enables you to create high-end, stable Web sites.
PHP code is interpreted and executed. PHP code in a script can query databases, create images, read and write files, talk to remote servers- the possibilities are endless. To run PHP on your computer you must have following components installed on it such as:
1. Web Server (IIS or Apache), 2. PHP and 3.Mysql (optional).
Before starting to program in PHP, you need a Web Server with PHP parser and, if needed, a Database. You can obtain the software needed downloading the LAMP package that contains the typical configuration of Linux, Apache, MySQL and PHP. For windows users, there are the WAMP package.
In PHP programming basic class definitions begin with the keyword class, followed by a class name, followed by a pair of curly braces which enclose the definitions of the properties and methods belonging to the class. The class name can be any valid label which is a not a PHP reserved word. A valid class name starts with a letter or underscore, followed by any number of letters, numbers, or underscores
Variables in PHP are represented by a dollar sign followed by the name of the variable. The variable name is case-sensitive. Variable names follow the same rules as other labels in PHP. A valid variable name starts with a letter or underscore, followed by any number of letters, numbers, or underscores.
PHP is a very stable and mature language used for web programming much like Java and Microsoft C#. Since PHP is open source software and runs on a wide variety of operating systems, including Windows, Mac OS, Linux, and most Unix variants.
Database: It is very easy to write simple scripts which allow your Web site to interact with a database.
Cross-Platform: Both the PHP engine and the PHP code can be used on almost any platform, making it extremely versatile.
Development Tools: You only need a text editor to work on PHP; you do not need any development environment or compilers.
Thus PHP is a very well-established language.