keithg

set Custom empty message in datatable

$(‘#accalls’).dataTable({ “language”: { “sEmptyTable”: “Set Custom Message”, // no record in a table “infoEmpty”: “Set Custom Message”,  // when search and not found “zeroRecords”: “Set Custom Message”, } });Read more …
keithg

Autoloading classes

PHP 5 introduced the magic function __autoload() which is automatically called when your code references a class or interface that hasn’t been loaded yet. This provides the runtime one last chance to load the definition before PHP fails with an error. Here’s an example of an extremely basic __autoload() implementation: I have a one...Read more …
Hiren Kukadiya

Get Time of last upload files in folder

Using below function we can get last uploaded file time. filectime  $path = “YOUR_FOLDER_PATH” function listdir_by_date($path){ $dir = opendir($path); $list = array(); while($file = readdir($dir)){ if ($file != ‘.’ and $file != ‘..’){ $ctime = filectime($path . $file); $ctime = date(‘Y-m-d H:i:s’, $ctime); $list[$file] = $ctime; } } closedir($dir); krsort($list);...Read more …
keithg

array_combine Vs array_merge

array_combine Vs array_merge ======================= <?php $array1    = array(“subject1″,”subject2″,”subject3”); $array2    = array((“php”,”html”,”css”); $new_array = array_combine($array1, $array2); print_r($new_array); ?> OUTPUT :Array([subject1]  => php[subject2]    => html[subject3]    =>css) ===================== <?php $array1 = array(“one” => “java”,”two” => “sql”); $array2 = array(“one” => “php”,”three” => “html”,”four”=>”Me”); $result = array_merge($array1, $array2); print_r($result);?> Array...Read more …