function first_last_day($string, $first_last, $format) { $result = strtotime($string); $year = date('Y',$result); $month = date('m',$result); $result = strtotime("{$year}-{$month}-01"); if ($first_last == 'last'){$result = strtotime('-1 second', strtotime('+1 month'...