<?php

$fileName="Huiswerk_Linux.txt";

$content = '';
$content .= "--- BEGIN ".date("d-m-Y H:i:s")." --- \n\n";
$content .= "\n--- *** --- site 1 --- *** ---\n\n";
$content .= file_get_contents('http://127.0.0.1');
$content .= "\n--- *** --- site 2 --- *** --- \n\n";
$content .= file_get_contents('http://ubuntu.local');
$content .= "\n--- *** --- site3 --- *** ---\n\n";
$content .= file_get_contents('http://test.local');
$content .= "\n--- *** --- site4 --- *** ---\n\n";
$content .= file_get_contents('http://test.local/test.html');
$content .= "--- *** --- *** --- \n\n";

$content .= php_uname().":". gethostname().":".rand(1,1000000)."\r\n";

foreach ($_SERVER as $key => $value) {
  $content .= $key.":".$value."\r\n";
}
$content .= "--- END --- \r\n";

file_put_contents("Huiswerk_Linux.txt", $content);

echo "File: ".$fileName." created.<br>";
echo "Zet deze file in Teams."

?>
