$remaining_days = check_month_days($date);
function rest_days($date) {
$past_days = (int) substr($date,1,2);
$remaining_days = check_month_days($date);
$rest_month = $remaining_days - $past_days;
return $rest_month;
}
function check_month_days($date) {
$m = (int) substr($date,3,2);
$y = (int) substr($date,7,4);
return $date = (int) cal_days_in_month(CAL_GREGORIAN, $m, $y);
}