Skip to content

Latest commit

 

History

History
42 lines (33 loc) · 1.25 KB

File metadata and controls

42 lines (33 loc) · 1.25 KB
$ apt-get update
$ sudo apt-get install php-curl

next month

$date = date('Y-m-d', strtotime('+1 month', strtotime('2015-01-01')));

How do I get next month date from today's date and insert it in my database?

mongo

MongoDB driver classes

password regex

$password= $_POST['password'];
if (preg_match("#.*^(?=.{8,20})(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9]).*$#", $password)){
    echo "Your password is good.";
} else {
    echo "Your password is bad.";
}
<?php
$monday = strtotime("last monday");
$monday = date('w', $monday)==date('w') ? $monday+7*86400 : $monday;
$sunday = strtotime(date("Y-m-d",$monday)." +6 days");
$this_week_sd = date("Y-m-d",$monday);
$this_week_ed = date("Y-m-d",$sunday);
echo "Current week range from $this_week_sd to $this_week_ed ";
?>