$value){ $_ENV[$key] = $value; } for ($i = 1; $i <= 25; $i++){ $context = stream_context_create([ 'http' => [ 'header' => 'Cookie: session=' . $_ENV["SESSION_COOKIE"] . '\r\n' ] ]); $contents = file_get_contents("https://adventofcode.com/2024/day/$i/input", context: $context); file_put_contents("../input/$i.txt", $contents); }