| Sam Granger |
07-24-2009 05:33 PM |
Some questions about file_get_contents
How do I manage to get the following, but with file_get_contents instead of fopen?
PHP Code:
$fp = fopen($filename, 'r');
$content = implode('', file($filename));
$content_array = explode($seperator, $content);
I tried quite a few things, all without success.. :-/
My second question, I know file_get_contents is faster than fopen, reason why I'm using it. But is it more efficient for what I'm using fopen to do? I'm wanting to use this to convert a CSV into an array.
|