Posted by CoreyWhite on 02/18/07 02:06
This code runs @ http://www.ckoogle.com but the trouble is once I get
the list backwards, and in an array. I can't sort the new array into
alphabetical order. Anyone know a way to do it?
<?php
echo '<form action="index.php" method="post">';
echo '<textarea name="input" cols="12" rows="20">';
echo '</textarea><br>';
echo '<input type="submit" value="Submit">';
echo '</form>';
if( isset( $_POST["input"] )){
$my_array = $_POST["input"];
$my_array=strrev($my_array);
$my_array=explode("\n", $my_array);
print_r($my_array);
sort($my_array);
print_r($my_array);
for($cnt=0; $cnt < count($my_array); $cnt++)
{
echo(strrev($my_array[$cnt]));
echo('<br>');
}
}
?>
Navigation:
[Reply to this message]
|