format('d'), (int)(new DateTimeImmutable('second monday of this month'))->format('d'), (int)(new DateTimeImmutable('third monday of this month'))->format('d'), (int)(new DateTimeImmutable('fourth monday of this month'))->format('d'), ]; $directory = sprintf( "tasks/%s/%s/%s", $dt->format('Y'), $dt->format('F'), $dt->format('W') ); $completedTasksFile = "$directory" . "/completed.txt"; $completedTasks = file_exists($completedTasksFile) ? lines(trim(file_get_contents($completedTasksFile))) : []; $closestMonday = closest($dt->format('d'), $mondays); $tasksForTheWeek = getTasksForTheWeek( array_search($closestMonday, $mondays), $dt->format('m'), require 'taskMatrix.php' ); $unfinished = array_diff($tasksForTheWeek, $completedTasks); print_r( array_diff(['treeflowers', 'someothershit'], ['treeflowers']) );