PHPs Database Operation Go OOP


This tip is a guide to writing database operation code in PHP - the Object Oriented way. I have come across people asking me the proper way of writing database operation code in PHP on a number of occasions. Not wanting to answer the same question over and over again, I have decided to publish the answer here.


The Approach

Step 1: Create a PHP page called "config.php" that ...

  • 08 Oct 2014
  • Peter Leow
  • PHP-5
  • 1601 Read
  • 23 Comments
READ MORE

Working With Date And Time In Object Oriented Way


Date and time manipulation in PHP is mostly connected with functions like: date, time or strtotime. They can be sufficient, but if we want to deal with dates like with objects we can use DateTime class. DateTime class is not only straightforward wrapper for standard functions, it has a lot of additional features for example timezones.

Date creation

public DateTime::__construct() ([ string $time = "now" [, DateTimeZone $timezone ...
  • 05 Sep 2014
  • Slawek Lukasiewicz
  • PHP-5
  • 1075 Read
  • 31 Comments
READ MORE