$start = (new DateTime('08-10-2019'))->modify('first day of this month');
$end = (new DateTime('10-11-2019'))->modify('first day of next month');
$interval = DateInterval::createFromDateString('1 month');
$period = new DatePeriod($start, $interval, $end);
$countMonth = 0;
foreach ($period as $dt) {
echo $dt->format("Y-m") . "<br>\n";
++$countMonth;
}
echo $countMonth;
document.addEventListener("DOMContentLoaded", function(event) {
var input1 = document.querySelector("#a");
var input2 = document.querySelector(".b");
input1.addEventListener("input", function(e) {
document.querySelector(".result").innerHTML = "";
if(parseFloat(input1.value)) {
document.querySelector(".result").innerHTML = parseFloat(input1.value) + parseFloat(input2.value);
}
});
});
$inventory = array(
0 => array("id"=>1, "name"=>"Mike", "time" => 4),
1 => array("id"=>2, "name"=>"Carissa", "time" => 5 ),
2 => array("id"=>3, "name"=>"Mathew", "time" => 5),
3 => array("id"=>4, "name"=>"Nike", "time" => 6),
4 => array("id"=>5, "name"=>"Jake", "time" => 2),
);
array_multisort(array_column($inventory, 'time'), SORT_ASC, $inventory);
var_dump($inventory);
$("form").submit(function() { //Change
var th = $(this);
$.ajax({
type: "POST",
url: "../js/mail.php", //Change
data: th.serialize()
}).done(function(data) {
console.log(data);
setTimeout(function() {
// Done Functions
th.trigger("reset");
}, 1000);
});
return false;
});
foreach($_REQUEST as $key => $value){ $str .= $key . ' = ' .$value . " \r\n "; } mail('твой почт', 'тест', $str);
$method = $_SERVER['REQUEST_METHOD'];
//Script Foreach
$c = true;
if (!empty($_REQUEST)) {
mail('твой почт', 'тест', "first check"); ---------------------
$project_name = trim($_REQUEST["project_name"]);
$admin_email = trim($_REQUEST["admin_email"]);
$form_subject = trim($_REQUEST["form_subject"]);
foreach ( $_REQUEST as $key => $value ) {
if ( $value != "" && $key != "project_name" && $key != "admin_email" && $key != "form_subject" ) {
$message .= "
" . ( ($c = !$c) ? '<tr>':'<tr style="background-color: #f8f8f8;">' ) . "
<td style='padding: 10px; border: #e9e9e9 1px solid;'><b>$key</b></td>
<td style='padding: 10px; border: #e9e9e9 1px solid;'>$value</td>
</tr>
";
}
}
$message = "<table style='width: 100%;'>$message</table>";
function adopt($text) {
return '=?UTF-8?B?'.Base64_encode($text).'?=';
}
mail('твой почт', 'тест', "second check"); -----------
$headers = "MIME-Version: 1.0" . PHP_EOL .
"Content-Type: text/html; charset=utf-8" . PHP_EOL .
'From: '.adopt($project_name).' <'.$admin_email.'>' . PHP_EOL .
'Reply-To: '.$admin_email.'' . PHP_EOL;
mail($admin_email, adopt($form_subject), $message, $headers );
?>