A new array problem for me
I have a file 'profiles.txt' which contains the info on my members, this contains an array:
<BLOCKQUOTE><font size="1" face="Verdana,Arial,Helvetica">code:</font><HR><pre>
$privateers = array(
"tom" => "tom's stuff",
"jim" => "jim's stuff",
"andy" => "andy's stuff"
What I want to do is sort the array alphabetically by the keys. I know how to do this using ksort() but I need to know how to output the revised $privateers array to profiles.txt and overwrite the original array and only that array.
Also how can I cann I add to the array from a form? I have a form worked out and I know how to output that to a file but it completely overwrites the entire file or adds on to the very end.
How do I add it to the end of the array?
Thanks again for your time and help (if any)