Here is what I basiaclly want to do. I want to convert this, which does split by spaces, to split by each character.
//gather posted info and split it up
$post = $_POST['post'];
$post = strip_tags($post);
$post = stripslashes($post);
$arr = explode(" ", $post);
$num = count($arr);
//check to see if they are trying to flod server
if($post>chr(1000)){ echo "Post is too big. Try again"; exit(); }
//start for statement, making a random color each pass and editing the post variable
for($i=0; $i<$num; $i++){
$color = rand(0,6);
//start switch
switch($color){
case "0":
$s = "";
$e = " ";
break;
case "1":
$s = "[red]";
$e = "[/red] ";
break;
case "2":
$s = "[blue]";
$e = "[/blue] ";
break;
case "3":
$s = "[purple]";
$e = "[/purple] ";
break;
case "4":
$s = "[gray]";
$e = "[/gray] ";
break;
case "5":
$s = "[orange]";
$e = "[/orange] ";
break;
case "6":
$s = "[green]";
$e = "[/green] ";
break;
}
//end switch
$glue = $s.$arr[$i].$e;
$arr[$i] = $glue;
} //end for statement
//end cutting and pasting
//begin displaying
echo "<h1>Copy and paste</h1><br>";
for($q=0; $q<=$num; $q++){
echo $arr[$q];
}