Category: Snippets

PHP Class Customization trait 

I’ve written a trait to help with customizing classes behaviors. For example if you have a class A with method getName() but in this method you want to check whether you want the full name to be returned or just the last or first name,…

PHP: How to get Current Date 

There are multiple ways which can be used to get PHP Current Date, I’m going to start with the simplest way. the date will return a string

According to PHP Manual, date() takes two parameters, the first one is format the second one is…

PHP: CSS Merge & Compress 

Ever wanted a class to merge your CSS files into one and compresses them as well? I wrote this class and it does the trick, these few lines of codes right there can add css files a queue and render them later, it has few…