Author: emad.ha

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 get Array Values from another Array Keys 

Let’s say you have these two arrays :

And you want to grab two items of this array without using foreach and conditions, what would you do? The solution is simple, we’re going to use array_intersect_key in conjunction with array_flip to get an array…

How to get filename from a URL 

Use this:

Nice and easy.

PHP how to echo an Array 

There are multiple ways to print/echo and array in php:

 

PHP: How to get the Max and Mix value in an Array 

It is very simple to get the Max and Min value in an array, with a built in function .

 

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…