Created
April 25, 2013 15:22
-
-
Save hellocatfood/5460556 to your computer and use it in GitHub Desktop.
Simple script to reorder sentences.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<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