PHP Tutorial – Language Introduction
Before we can start coding you first need to know some basics. In this PHP language introduction tutorial you’ll find some descriptions of words you should know before you can start coding. Of course we will also look at where you can download PHP, MySQL and Apache.
What is PHP?
The PHP programming language is a server-side HTML embedded scripting language.
Let‘s depict the sentence. The PHP language runs on the server-side. This means that the execution (read starting) of the scripts are done on the server where the web-site is hosted. HTML embedded means that you can use PHP statements (read a piece of PHP code) from within an HTML code. PHP files are returned to the browser as plain HTML.
The last piece of the sentence – scripting language – is a little harder to explain, but we will give it a go. A scripting language is a form of programming language that is usually interpreted rather than compiled. In programming languages such C or C++ you compile the program (permanently) into an executable file, before you can execute the program. A program that is written in a scripting language, is interpreted one command at a time by a command interpreter (Command interpreter is in most cases an executable written in another language (for instance C/C++) than the scripting language.) Some other examples of scripting languages are Perl, Phyton, Java and Ruby.
A last note: scripting languages are also often used by applications as control or configure language. An example: Firefox is written in C/C++ and can be controlled with JavaScript.
Things You Should Know
Because PHP is an HTML embedded language you should have a basic understanding of HTML/XHTML and (a little) JavaScript. In the coming tutorials we will explain the PHP code, but we won’t explain the HTML code (at least not in great detail.)
What is PHP?
- PHP stands for PHP: Hypertext Preprocessor.
- As we said before it is a server-side scripting language.
- PHP is free and is an open source software product.
- The PHP scripts are executed on the server.
- PHP supports many databases (MySQL, Sybase, Oracle and many others.)
- PHP runs on different platforms (Unix, Linux, Windows.)
- PHP is compatible with almost all web-servers used today (Apache, IIS, etc.)
- A PHP file can contain plain text, HTML tags and scripts
- The PHP files can have one of the following extensions: php, php3 or phtml.
What do you need?
Before you can follow the coming PHP tutorials you need to have the following:
- Access to a web server (like Apache)
- PHP and MySQL should be installed on the web server.
The easiest way is to find a cheap web hosting plan that support PHP and MySQL (most of the web-hosting providers do.) For a couple of bucks a month you can get a virtual host. The advantage is that everything is already installed and that you can share your program (that you are going to write) with the rest of the world.
If you don’t want to spend money, you can also install everything on your local machine. The easiest way is to install WAMP if you have a Windows machine and LAMP if you have a Linux machine. (WAMP = Windows Apache MySQL PHP and LAMP = Linux Apache MySQL PHP.) These packages install everything you need. Read the install manual of these packages for instructions. After installation you should have access to http://localhost in your browser.
The examples on this Site
To keep things small we will not place every example between <html> <body> some piece of PHP code </body></html>. In most cases you need to add it yourself if you cut/paste some piece of code.
That is all for this PHP language introduction tutorial. We hope that you will learn something from the coming PHP tutorials and as always we hope that you will let us know if something is wrong by leaving us a comment.
actually sir i wants to know that ,,,if i did not have any knowledge about c and c++ languages,
still is that possible to learn php …
@harit Of course it is possible to learn php without c or c++ knowledge. Just following the php tutorials on this website and you’ll be well on your way!
Thanks sir u have given very good contents.It is very helpful for not only me but also for other interested students….
thank u sir for giving valuable information about php.
thank you for this tutorial it is useful..
emphasize a bit on some of the applications of php and is it a necessary tool for telecommunications engineer
Thanks sir u have given very good contents.It is very helpful for not only me but also for other interested students….
thanq vry much.. this tutorial is vry useful for us
Thank you so much for this. which language is best to start with as a new learner in programming
hello sir i have wamp server installed on my pc, so my question is do i need to install ny text editor like dreamweaver or the notepad wil be sufficient for php coding??
@sindhu : Notepad or notepad-plusplus should be sufficient to write php scripts. You can also use eclipse, which has code highlighting and debug options. Good luck
Thanks sir u have given very good contents.It is very helpful for not only me but also for other interested students….