What have you tried so far that didn't work?
Hmm... maybe try something like this:
<?php
// array
$array = array(1,2,3,4,5,6,7,8,9,0);
// start string to add to file:
$str = '<?php' . "\n";
$str .= '$array = array(';
foreach($array as $value){
$str .= '\'' . $value . '\',';
}
$str .= ');' . "\n";
$str .= '?>';
// write to file:
$file = 'test.php';
$fp = fopen($file, 'w');
fwrite($fp, $str);
fclose($fp);
?>
(this is for writing an array to a .php file)