file_put_contents writes a string to a file, not an array. http://php.net/manual/en/function.file-put-contents.php
If you'd like to write what you see there in that print_r to a file, you can try this:
ob_start();
print_r($myarray);
$output = ob_get_clean();
file_put_contents("myfile.txt",$output);