Alguém sabe me dizer qual das duas alternativas abaixo é melhor para
receber conteudo externo ?
Alguma diferença na performance?
<?
/* Buscar conteudo externo */
$get_conteudo = implode(file('http://www.google.com'), '');
$get_conteudo = file_get_contents('http://www.google.com');
?>
FILE_GET_CONTENTS:
http://br.php.net/ma...et-contents.phpstring file_get_contents ( string $filename [, int $flags [, resource $context [, int $offset [, int $maxlen ]]]] )
Esta função é semelhante à file(), exceto que file_get_contents() retorna o arquivo em uma string, começando a partir de offset até maxlen bytes. Em caso de falha, file_get_contents() retornará FALSE.
file_get_contents() é o método preferível para ler o conteúdo de um arquivo em uma string. Ela usa técnicas de mapeamento de memória suportadas pelo seu SO para melhorar a performance.
FILE():
http://br.php.net/ma...nction.file.phparray file ( string $filename [, int $flags [, resource $context ]] )
Carrega todo um arquivo em um array.