You are here: Sorting alphabetically backwards lists « PHP Programming Language « IT news, forums, messages
Sorting alphabetically backwards lists

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]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация