function get_max_days_in_month($month, $year) { $getdate = getdate(mktime(null, null, null, $month + 1, 0, $year)); return $getdate['mday']; }
Monthly Archives: February 2012
Max days in a month with PHP
Posted by zechim
on 28/02/2012
No comments
Last weekday in a month with PHP
Posted by zechim
on 28/02/2012
No comments
First weekday in a month with PHP
Posted by zechim
on 28/02/2012
No comments
chmod recursive
Posted by zechim
on 10/02/2012
No comments
function chmod_r($path, $filemode) { if (!is_dir($path)) { return chmod($path, $filemode); } $dh = opendir($path); while ($file = readdir($dh)) { if ($file != '.' && $file != '..') { $fullpath = $path.'/'.$file; if (!is_dir($fullpath)) { if (!chmod($fullpath, $filemode)) { return false; } } else { if (!chmod_r($fullpath, $filemode)) { return false; } } } } closedir($dh); if (chmod($path, $filemode)) { return true; } return false; }
usage:
chmod_r('your/path', 0777);
Page 1 of 11
Recent Comments