Reply to Sort array from .dat file

Your name:

Reply:


Posted by Dan R. on 07/17/07 16:40

I'm using the following to open and print values from a .dat file but
I can't figure out how to sort the results. I think I need to use
either the array_multisort() or krsort() functions. If so, how would I
do that?

<html>
<body>
<pre>
<?php

$fp = fopen("datfile.dat", r);
$count = 0;
while(!feof($fp))
{
$register = fgets($fp, 4);
$sales = fgets($fp, 5);

$register_array[$count] = $register;
$sales_array[$count] = $sales;

print "Register: $register_array[$count]<br>";
print "Sales: $sales_array[$count]<br>";
$count = $count + 1;
}

?>
</pre>
</body>
</html>

--
Thanks,
Dan

[Back to original 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

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