Merge Sort

<?php $arr = array( 6,1,3,7,5,2,3,4,45,5,4,75,8,6,78,7980890,2,4,2,432,5,34,5634,34,5); echo “<br>”.implode(‘,’,$arr).”<br>”; $arr=mergesort($arr); echo implode(‘,’,$arr); function mergesort($numlist) { if(count($numlist) == 1 ) return $numlist; $mid = count($numlist) / 2; $left = array_slice($numlist, 0, $mid); $right = array_slice($numlist, $mid); $left = mergesort($left); $right = mergesort($right); return…

Google Map Autocomplete Address

Here is the complete code to add google map autocomplete search box. Generate Google key from the following URL : https://developers.google.com/maps/documentation/javascript/get-api-key Note:Replace googlekey in the below code with your genrated one <!DOCTYPE html PUBLIC “-//W3C//DTD XHTML 1.0 Transitional//EN” “http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd”> <html…

Idle User Logout

Hi this post is for implementing idle user logout. I have written it using wordpress db object. Because wordpress is based on cookies and default expiry time is 2 weeks. But wordpress does not provide any intuit functionality for logging…

Comparing and finding matched elements from an array

Often it comes to requirement when we need to compare and return matched set of values from an array. Exm: Suppose we have an array like $array=array(‘audios/2015/01/audio_54c74d9d8b2bf__pd.m4a’, ‘audios/2015/01/audio_54c74d9d8b47e__pd.m4a’, ‘videos/2015/01/videos_54c75416c186d__pd.mp4’, ‘images/image_55c2fef42332.jpg’, ‘images/image_tt.jpg’, ‘videos/video_tt.jpg’ ) WE want to find images that start…

Page 3 of 712345...Last »