Skip to content

Instantly share code, notes, and snippets.

@Guley
Created March 10, 2019 08:01
Show Gist options
  • Save Guley/2fdafdc12f310022b77123b6be5e12a1 to your computer and use it in GitHub Desktop.
Save Guley/2fdafdc12f310022b77123b6be5e12a1 to your computer and use it in GitHub Desktop.
Get all next week days from current date
<html>
<head>
<title>Online PHP Script Execution</title>
</head>
<body>
<?php
$day = Date('N',strtotime('2019-03-13 02:00:00'));
$weekArr = ['Mon','Tue','Wed','Thu','Fri','Sat','Sun'];
$newDaysArr=[];
foreach($weekArr as $key=>$val){
if($key >= $day-1){
array_push($newDaysArr,$val);
}
}
echo '<pre>';
var_dump(in_array('Mon',$newDaysArr));
?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment