Pandemikk - there is going to be over 500 profiles and 300 catagories, i have condensed the catagories from 300 to 8 to make it smaller to post, + i would need to add to the code everytime i add to the profile. making more work for me.
MikeDean89 - your code only sorts by the $p_id, whitch i can do by just adding sort($lines); to the code that i already have like this.
<?php
$lines = file('database/profile.txt');
sort($lines);
foreach($lines as $thisline){list($p_id,$p_status,$p_filestart,$p_filemodified,$p_first,$p_middle,$p_last,$p_nick) = explode('|',$thisline);{
$names []= $p_last.', '.$p_first.' '.$p_middle.$p_id.'.';
foreach($names as $value);
{echo ''.$value.'<br>';}}}
?>
the code is going to be used in a drop down box like this:
Person <select name="person">
<option value=""></option>
<?php
$lines = file('database/profile.txt');
foreach($lines as $thisline){list($p_id,$p_status,$p_filestart,$p_filemodified,$p_first,$p_middle,$p_last,$p_nick) = explode('|',$thisline);{
$names []= $p_last.', '.$p_first.' '.$p_middle.$p_id.'.';
foreach($names as $value);
{echo '<option>'.$value.'</option>';}
}}?>
</select>
your help is not unappreciated, i thank you both for your help. but the code i have works great, i just need it to sort by $p_last.
with over 500 profiles it would take allot of time to find a name in a drop box if they are not in alphabetical order.