PHP Array Merge with preserve keys

Here are two arrays, use UNION array operator to merge $array1 and $array2 with preserve keys and no transformation of keys and values. $array1 = array( 1..

Read More » Posted on 2016-04-17 05:48:42

PHP Array Array Merge

PHP Associative Array to slice or get first n elements and preserve keys

From an array, want to get first 5 elements with keys preserved. The array_slice() with 2nd and 3rd parameter will limit the array to get first 5 elements. $array =..

Read More » Posted on 2016-04-17 05:44:28

PHP Array Array Slice

PHP Image or Video duplicate check with MySQL

It is easier to check duplicate or changed file like images, videos, text files and so on. Syntax $sha_hash = sha1_file(file_path); sha1_file() is using the US Secure Hash Algorithm 1 it..

Read More » Posted on 2016-04-17 05:35:42


Proper way to Redirect 404 in PHP

Developers or SEOs handling 404 redirection by many ways. The proper way is to include the 404-error page and send 404 status code. Then, stop further code execution by exit or die functions...

Read More » Posted on 2016-04-09 06:24:08

PHP 404 Redirection