<!DOCTYPE html>
<html>
	<head>
		<title>YAML test</title>
	</head>
	<body>
		<form method="POST" enctype="multipart/form-data">
			<label for="file1">File: </label><input id="file1" name="file1" type="file" />
			<input type="submit" value="Upload" />
		</form>
		<?php

			if ($_SERVER["REQUEST_METHOD"] === "POST")
			{
				$file1 = $_FILES["file1"];
				if ($file1["error"] === UPLOAD_ERR_OK)
				{
					if ($file1["size"] > 100000)
					{
						die();
					}

					$yaml = \yaml_parse(file_get_contents($file1["tmp_name"]));

					print_r($yaml);
				}
				else{
					print_r($file1);
				}
			}

		?>
	</body>
</html>