Created
December 20, 2013 20:27
-
-
Save joglr/8060932 to your computer and use it in GitHub Desktop.
Minecraft chat message colorfier.
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
<?php | |
$str = $_GET['string']; | |
$str = explode(' ', $str); | |
$colors = array('a', 'b', 'c', 'd', 'e', '1', '2', '3', '4', '5', '6', '7', '8', '9'); | |
foreach($str as $key => $value) { | |
$color = $colors[rand(0, count($colors)-1)]; | |
$str[$key] = utf8_decode('§').$color.$value; | |
} | |
$str = join(' ', $str); | |
?> | |
<meta chartset="UTF-8" /> | |
<style> | |
body { | |
font-family: Helvetica, Arial, Verdana, sans-serif; | |
} | |
</style> | |
<form method="get"> | |
<output> | |
<div>Input: <input type="text" name="string" value="<?php echo $_GET['string']; ?>" /><input type="submit" /></div> | |
<div>Output: <input type="text" value="<?php echo $str; ?>" /></div> | |
</output> | |
</form> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment