# Sort data in alfabetical order from a txt file

**URL:** <https://forum.kirupa.com/t/sort-data-in-alfabetical-order-from-a-txt-file/19953>\
**Category:** programming\
**Created:** [May 3, 2003, 10:34am UTC](https://forum.kirupa.com/t/sort-data-in-alfabetical-order-from-a-txt-file/19953 "2003-05-03T10:34:19Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![mooler](https://avatars.discourse-cdn.com/v4/letter/m/b4bc9f/32.png) [@mooler](https://forum.kirupa.com/u/mooler)\
**Post date:** [May 3, 2003, 10:34am UTC](https://forum.kirupa.com/t/sort-data-in-alfabetical-order-from-a-txt-file/19953/1 "2003-05-03T10:34:19Z")

</div>

I get my data from a txt file.  
Is it possible to get that data and sort it in alfabetical order and then send it to my flash movie?  
How do I do that?  
Here´s the code I use to get the data from the txt file

```php
	$filename = "nyheterinput.txt";

	$fp = fopen( $filename,"r"); 
	$Data = fread($fp, 800000); 
	fclose( $fp );

	$DataArray = split (".:::.", $Data);

	$NumEntries = count($DataArray) - 1;

	print "&TotalEntries=$NumEntries&NumLow=$NumLow&NumHigh=$NumHigh&GuestBook=";
	for ($n = $NumLow; $n < $NumHigh; $n++) {
	print $DataArray[$n];
		if (!$DataArray[$n]) {
			Print "<br><br><b>No More entries</b>";
		exit;
		}
	}

```

The text in the txt file is in html format does that affect the sorting in any way?  
Thx

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [May 5, 2003, 7:08am UTC](https://forum.kirupa.com/t/sort-data-in-alfabetical-order-from-a-txt-file/19953/2 "2003-05-05T07:08:33Z")

</div>

you can said acending or decending, but on a textfield, i don’t really know, try it with one of these words
