R4R provide basic PHP Tutorials concept with
PHP Examples .
Through R4R you can develop PHP programming concept. R4R provide
PHP Interview Questions with answers.R4R provide PHP Languages study materials in easy way.
PHP- Hypertext Preprocessor is server side script language
like ASP. Its scripts executes on server. PHP is open source software.
The goal of PHP language is to allow web developers to write dynamically
generated pages quickly.
- PHP was released in 1995 by a programmer â€“ Rasmus Lerdorf and is now
maintained by PHP Group.
- Its original full form was personal homepage tools.
- Zeev and Andi rewrote the parser for PHP to launch PHP3 with a full form
- It can be used with different operating systems like Microsoft Windows,
Linux, UNIX and Solaris.
- It can be linked to different database systems easily.
The origins of PHP date back to 1995.PHP was written in the C
programming language by Rasmus Lerdorf in 1995 for use in monitoring his online
resume and related personal information. For this reason, PHP originally stood
for "Personal Home Page".
- Lerdorf combined PHP with his own Form Interpreter, releasing the
combination publicly as PHP/FI (generally referred to as PHP 2.0) on June 8,
- Zeev Suraski and Andi Gutmans, rebuilt PHP's core, releasing the updated
result as PHP/FI 2 in 1997.
- PHP 3 was released in 1998, , which was the first widely used version.
- PHP 4 was released in May 2000, with a new core, known as the Zend Engine
1.0. PHP 4 featured improved speed and reliability over PHP 3.
- PHP 5 was released in July 2004, with the updated Zend Engine 2.0.
- PHP 6 has been in development since October of 2006.
How PHP works?
Here i am giving example for form like-
<FORM ACTION="display.html" METHOD=POST>
<INPUT TYPE="text" name="name">
<INPUT TYPE="text" name="age">
the content can be like -
<?php echo "Hi $ name, you are $ age years old!<p>" >
It's that simple! PHP automatically creates a variable for each form input field in your form.
You can then use these variables in the ACTION URL file.
The next step once you have figured out how to use variables is to start playing with some logical flow tags in your pages.
For example, if you wanted to display different messages based on something the user inputs, you would use if/else logic.
echo "Hi $name, you are ancient!<p>";
echo "Hi $name, you are very old!<p>";
echo "Hi $name.";
PHP provides a very powerful scripting language which will do much more than
what the above simple example demonstrates. See the section on the PHP Script
Language for more information.
Difference from Other language-
PHP and ASP-
- ASP is a Microsoft product based on the very awkward Visual Basic syntax.
PHP is a C-Like, very compact and well organized.
- ASP requires the registration of components to do that and very ackward
object declarations. Most of these components are not free.PHP can be easily
installed with a very large number of tools such as image manipulation,
upload, email, etc.
- ASP is very slow, PHP is way faster.
- ASP works better with SQL Server and Access. I have not used it with
MySQL, because it does not make sense. PHP works very very well with MySQL. It
works fine with SQL Server, SQL Server is costly.
PHP and JSP-
- JSP is Java and based on the J2EE specifications. PHP is PHP.
- JSP has strong typed data. All variables should be declared. PHP has
flexible, variable behave 'naturally' although they all have a type defined
behind the scenes (like integer, string, etc)
- JSP is Object-oriented, always. In PHP You can mix in Object-oriented
stuff to your liking.
- JSP is really resident and running on a server, so you always have
some running processes you can use for timers, etc. In PHP you can fire up the
PHP-engine when a request arrives from a client. So if you need scheduled
tasks, you have to fall back to cron and the like.
- Reduce the time to create large websites.
- Create a customized user experience for visitors based on information that
you have gathered from them.
- Open up thousands of possibilities for online tools. Check out PHP - Hot
Scripts for examples of the great things that are possible with PHP.
- Allow creation of shopping carts for e-commerce websites.
Show All Comments
- PHP is not pure Object Oriented scripting language.
- PHP has very poor handling errors qualities