rendered paste body<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en-US" lang="en-US">
<head>
<title>String parser</title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta name="author" content="Vivian Lam" />
<style type="text/css">
pre { border: 1px solid #ccc; padding: 1em; }
table td { border: 1px solid #ccc; padding: 0.5em; border-collapse: collapse; }
</style>
</head>
<body>
<form action="<?php echo $_SERVER['PHP_SELF'] ?>" method="post">
<p>Make it look something like this:</p>
<pre>
Name :: Anonymous
Food :: Pineapples
Drink :: Caesar's
Movie :: Labyrinth
Email :: hottie293874@hotmail.com
David Bowie? :: Yes
</pre>
<p><textarea name="stuff" rows="5" cols="" style="width:50%;"></textarea></p>
<p><input type="submit" value="FIRE AWAY"></input></p>
</form>
<?php
if($_POST) {
echo "<p>You made a table!</p>\n";
echo "<table>\n";
$fields = explode("\n", htmlspecialchars($_POST['stuff']));
foreach($fields as $field) {
$x = explode("::", $field);
echo "<tr><td>".trim($x[0])."</td><td>".trim($x[1])."</td></tr>\n";
}
echo "</table>";
}
?>
</body>
</html>