Ok, thanks i got the idea now but still when the array is saved to the vars.php file, theres a new line for each array entry which i can't have. Heres the snips of code i am using:
To input the array into the textarea with an array enty one per line:
$arrayFiles = implode("\n", $fileTypes );
To get the contents of the textarea and get it ready to go back into the array:
$arrayFiles = explode("\n", $_POST["fileTypes"]);
$fileArrayAdd = (implode("','",$arrayFiles));
And the way i write to the file:
$write .= "\$fileTypes = array('$fileArrayAdd');";
So how can i get ride of that line break in the array?