Category: PHP

Calculate Total Working Days using PHP class

/** Calculate working days class**/ class calculateWorkingDays { private $holidays = array(); private $holidates = array(); private $totalWorkingDays = 0; /** * Constructor */...

Convert Folder to Zip using PHP class

<?php class FolderToZipConverter { private $_isRecursiveVar = false; private $_foldersList = array(); private $_zipFileFilePath = ”; private $_zipFile; /** * Constructor */...

Google map with address in info window

Google provide lots of easy method to integrate map in your HTML or php. Here i am trying just to explain a simple method by which you can pass address at the time of initialization...

Add or Remove Dynamic Rows in HTML table

To add or remove html row here i am explaining with simple javascript and html. We can use Jquery and other stuff but it’s just to clear out basic concept by this you can...

Generate Random password with length and strength

We generally need a random password string for different purpose. Here i am sharing a simple php function to generate random password with user specific length. User can pass length...

Delete recursive directory in a folder

This is a simple function using php in built “unlink” function. I am using “deleteRootToo” parameter to delete root directory holding all sub directories....

Function to prevent string break in MySql insert

Mostly we used normal insert MySQL query, but in the same time if user inserted special characters then to prevent this we can use normal php function. Below is the example of...

Searching in php multidimensional array or array which containing another array

function in_multiarray($needles, $haystack) { foreach ($needles as $needle) { // Displays var name & value currently searching for) //echo ‘$needle: ‘.$needle;...

php function group an array on particular key value

function groupArrayOnIdStr($old_arr,$sortText){ $arr = array(); if(@is_array($old_arr)){ foreach($old_arr as $key => $item) { $arr[$item[$sortText]][$key] = $item; } }...