note 91829 added to function.filesize

From: Date: Fri, 26 Jun 2009 20:10:14 +0000
Subject: note 91829 added to function.filesize
Groups: php.notes 
Request: Send a blank email to php-notes+get-157617@lists.php.net to get a copy of this message
@Anonymous Re: Shortest solution to get filesize of a remote website It would be better to use strlen() instead so you don't have to write a temporary file and incur that extra overhead since the content is already in memory. <?php $size = strlen(file_get_contents("http://www.example.com")); ?> This was basically suggested by revoke, but no need to use file() and join() when you can just use file_get_contents() (unless you have an old version of php of course). ---- Server IP: 64.71.164.2 Probable Submitter: 70.15.41.173 ---- Manual Page -- http://www.php.net/manual/en/function.filesize.php Edit -- https://master.php.net/note/edit/91829 Del: integrated -- https://master.php.net/note/delete/91829/integrated Del: useless -- https://master.php.net/note/delete/91829/useless Del: bad code -- https://master.php.net/note/delete/91829/bad+code Del: spam -- https://master.php.net/note/delete/91829/spam Del: non-english -- https://master.php.net/note/delete/91829/non-english Del: in docs -- https://master.php.net/note/delete/91829/in+docs Del: other reasons-- https://master.php.net/note/delete/91829 Reject -- https://master.php.net/note/reject/91829 Search -- https://master.php.net/manage/user-notes.php

« previous php.notes (#157617) next »