PHP allows you to write code in two flavours, one is procedural and the other
is object oriented. You can even write procedural code in PHP5 and it will run
without any problems. If you are not clear about procedural and object oriented
programming, then we will have a look at these two different coding styles. The
following two examples are not fully running examples rather a pseudo code:

$user_input = $_POST[‘field‘];
$filtered_content = filter($user_input); //user input filtering
mysql_connect(“dbhost”,”dbuser”,”dbpassword”); //database
$sql = “some query”;
$result = mysql_query($sql);
while ($data = mysql_fetch_assoc())
process ($data);

You will notice using a lot of inline processing either directly or via using functions.
It may stand as an example of typical procedural operation. Let’s see how it looks
after converting it to OOP:

$input_filter = new filter();
$input_filter->filter_user_input(); //filter the user inputs
$db = new dal(“mysql”); //data access layer
$db->connect($dbconfig); //using mysql
$result = $db->execute($sql);
ReportGenerator::makereport($result); //process data
$model = new Postmodel($filter->get_filtered_content());

Now if you take a look into these two code snippets, you will find that the latter
one is much more readable. Well, you can make the first one more readable by
introducing some more functions into it, but how many functions are you ready
to search into when you use them? The latter snippet is better organized because
you know which object is handling which process. If you write big applications in
procedural style, it will be almost impossible to manage after a few versions. Of
course you can implement strict coding conventions, but it is agreed by millions
of developers that it won’t give you the ultimate manageability and usability if it’s
procedural unless you do it in OO style. Almost all big applications are written using
the object oriented approach.

Object-Oriented Programming with PHP5
Chapter 1, page 24