Skip to content

Instantly share code, notes, and snippets.

@hellocatfood
Created April 25, 2013 15:22
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save hellocatfood/5460556 to your computer and use it in GitHub Desktop.
Save hellocatfood/5460556 to your computer and use it in GitHub Desktop.
Simple script to reorder sentences.
<html>
<head>
<title>Text Shuffler</title>
</head>
<body>
<h2>Shuffle your sentences</h2>
<?php
if(!isset($_POST["submit"])) {
?>
<form method="post" action="index.php">
<textarea cols="50" rows="15" name="text"></textarea><br /><br />
<input type="submit" name="submit" value="Shuffle!">
</form>
<?php
} else {
$text = explode("\n",$_POST["text"]);
shuffle($text);
foreach($text as $t) {
echo $t . "<br />";
}
}
?>
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment