note 101557 added to function.sort
| From: | Anaz114119 at gmail dot com | Date: | Fri, 24 Dec 2010 10:29:07 +0000 |
| Subject: | note 101557 added to function.sort | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-175192@lists.php.net to get a copy of this message | ||
sort from textfile by coloumn
example name||date||time||comments
if you want to sort by date
$column = 2
<code>
function array_sort($array,$column){
$column = $column-1;
foreach($array as $line){
$bits = explode("||",$line);
$bits ="$bits[$column]**$line";
$array1[]=$bits;
}
asort($array1);
foreach($array1 as $line){
$bit = explode("**",$line);
$bit ="$bit[1]";
$array2[]=$bit;
}
return$array2;
}
</code>
www.toptenz.tk
www.miyaru.co.tv
----
Server IP: 69.147.83.197
Probable Submitter: 80.239.242.58 (proxied: 117.97.55.237)
----
Manual Page -- http://www.php.net/manual/en/function.sort.php
Edit -- https://master.php.net/note/edit/101557
Del: integrated -- https://master.php.net/note/delete/101557/integrated
Del: useless -- https://master.php.net/note/delete/101557/useless
Del: bad code -- https://master.php.net/note/delete/101557/bad+code
Del: spam -- https://master.php.net/note/delete/101557/spam
Del: non-english -- https://master.php.net/note/delete/101557/non-english
Del: in docs -- https://master.php.net/note/delete/101557/in+docs
Del: other reasons-- https://master.php.net/note/delete/101557
Reject -- https://master.php.net/note/reject/101557
Search -- https://master.php.net/manage/user-notes.php