Why PHP ?
Pros & Cons .
Fear of PHP.
Line of culture .
3. Why PHP ?
PHP is an excellent choice for Web programming.
It has many advantages over other languages, including
other Weboriented languages.
To get a very general understanding of how the common
Web programming languages compare, let’s compare
PHP ASP Java Perl
4. Why PHP ?
Microsoft’s Web programming environment.
It’s not a language itself because it allows the programmer
to choose from a few actual languages, such as VBScript or
ASP is simple, but too simple for programs that use
complex logic or algorithms.
Many companies find it hard to budget for
the expense of Microsoft licenses.
5. Why PHP ?
Java is platform independent.
It has serious downsides in development time, development
cost, and execution speed.
Java development is timeconsuming because projects in
Java must follow strict rules (imposed by Java) that require
Java developers are expensive to hire!
6. Why PHP ?
Perl has been around longer than PHP. Before PHP, Perl was
generally accepted as the best Web programming
You have to download separate modules to get the same
functionality in Perl.
This leads to problems when programs are transferred
from one system to another .
7. Why PHP ?
PHP’s primary use certainly isn’t to track résumés anymore.
It has grown to be able to do that and just about anything
PHP's common uses:
• Feedback forms
• Shopping carts and other types of ecommerce systems
• User registration, access control, and management for
online subscription services
• Guest books
• Discussion and message boards
Creating a PHP program requires that you actually work with
the source code of the file as opposed to a “what you see is
what you get” (WYSIWYG) approach.
“Installing the environment and web scenario”
The process you would use to create a PHP program is much
1. Create your HTML file (containing text, tables, images, or
sounds) and insert PHP code where desired.
2. Save your PHP file as filename.php.
3. Use an FTP program to upload your file to the Web server.
4. Point your browser to the address of the file on your Web
server (suchas http://www.example.com/filename.php).
<head><title> Example 1/title></head> HTML
<body bgcolor="white" text="black">
<h4>Chapter 1 :: Example 1</h4>
/* Display a text message */
echo "Hello, world! This is my first PHP program.";
Save. Upload to web server . Test.
The PHP interpreter (or parser) is the program that performs
the processing mentioned previously.
It reads the PHP program file and executes the
commands it understands.
If PHP happens to find a command it doesn’t understand, it
stops parsing the file and sends an error message back to
This is quite different from a compiled language, such as C or
C++, which is only interpreted from a humanreadable form
The most important limitations are :
must be correct commands.
ex: echo “Hi” > will not work.
echo “Hi”; > will work.
14. Language Constructors
Like the most of programming languages , but PHP has some
Variables & Constants.
Program Input & Output.
Arithmetic and String manipulations.
Classes and Objects.
Creating dynamic contents with PHP & MySQL.
Cookies and Sessions.
It's simple , so that there's no unified structure in writing
code,like Java for example..!
Hard to debug and maintain .. !
Hard for team oriented projects.
But , developers made somethings called “Frameworks” ,
following some design patterns to unify the way all
programmers work with.
16. Object Oriented Aspects
PHP has the ability to “include” files within a web page.
This reduces initial work and ongoing maintenance.
Imagine a website contains a menu at the top of each web
page, and this menu is identical throughout the site. You
could cut and paste the appropriate code into every page,
but this is both cumbersome and counterproductive.
This is the simple OO aspect in PHP.But there's more.
17. Object Oriented Aspects
You could summarize this approach as “include and reuse;
Objectoriented programming (OOP) is just an extension of
Objects simplify web development by eliminating the need
to cut,paste, and adapt existing code.
18. Arguments for OO PHP
1. It's just a scripting language.
“Some scripting languages simply string together a series of
commands and for this reason are sometimes referred to as
An OO scripting language is a contradiction in terms; it’s a
language that’s“getting above itself.”
The limited OO capabilities of PHP 4 reinforced the view that
a scripting language shouldn’t attempt to be object
19. Arguments for OO PHP
2.Object Orientation Is for Large Software Shops
OOP is something best left to the large shops.
If a number of programmers are involved in the same
project, an OO approach is a necessary evil, but it’s not
much use for the lone developer.
OOP doesn’t replace procedural programming or make it
Nor is an OO approach always the right approach, as some
OO enthusiasts might have you believe.
However,some web problems require an OO solution.
without a minimal understanding of the basics of OOP, you
can’t make full use of the capabilities of PHP 5.
Example: if you want to create a SOAP client, there is really
no other way to do it than by using the SOAPClient class.
21. Fear of PHP
Fear of PHP becoming overly complex is often a more subtly
stated objection to an OO PHP.
There’s no doubt that OOP can sometimes introduce
This hasn’t happened with PHP, and there’s good reason
to suspect that it won’t.
PHP is first and foremost a web development language
(which is probably why it has taken so long for PHP to adopt
an OO approach).
22. Fear of PHP
The point of object orientation in PHP is not to turn PHP into
Java or something similar, but to provide the proper tools for
Object orientation is another strategy for adapting to the
current circumstances of “web development”.
23. A line of culture
(KISS) : Keep IT Simple , Stupid !
There will be a learning curve for a procedural programmer
adopting an OO approach to web development,
In fact, you’ll probably find that some of the tasks you’re
used to doing procedurally are more easily done in an OO