file_put_contents writing include to new file
<p>I have a variable that contains an array from form data, seen below:</p>

<pre><code>$option1 = explode("\n", $_POST['form1']);
</code></pre>

<p>I then write the array to another file:</p>

<pre><code>$test = array($option1);
$file = 'test.php';
file_put_contents($file, '&lt;?php \n\n $array=' . var_export($test, true) . ';' . '\n');
</code></pre>

<p>I would like to write/include a file or a large amount of code in the test.php file above to manipulate the $array. When trying the below code it just prints the contents of the include file to the current page instead of writing it:</p>

<pre><code>file_put_contents($file, include('includefile.php'));
</code></pre>
