RE: [PHP-DEV] Additional argument in funtion file($a, $b)
| From: | Marten Gustafsson | Date: | Wed, 24 Jan 2001 11:41:01 +0000 |
| Subject: | RE: [PHP-DEV] Additional argument in funtion file($a, $b) | ||
| References: | 1 | Groups: | php.dev |
| Request: | Send a blank email to php-dev+get-44891@lists.php.net to get a copy of this message | ||
I?ve also thought about this and think there should be funciton wich returns
the contents of a file as a string. Especially since implode("",
file($filename)) is or is at least said to be much slower than;
$content = fread(fopen($filename, 'r'), filesize($filename));
-Marten.
-----Original Message-----
From: Urs Gehrig [mailto:urs@circle.ch]
Sent: Wednesday, January 24, 2001 12:31 PM
To: php-dev@lists.php.net
Subject: [PHP-DEV] Additional argument in funtion file($a, $b)
dear all
having seen lots of applications using the following expression:
$cont = join ("", file ("test.xml"));
... i would like to propose an addtional attribute in the argument
list of the function file().
lets consider that:
$cont = file ("test.xml", FALSE) or $cont = file ("test.xml")
would be equivalent to:
$cont = file ("test.xml")
and on the other hand:
$cont = file ("test.xml", TRUE)
would be equivalent to:
$cont = join ("", file ("test.xml"))
the second argument would therefore represent an attribute, which
let one specify not only to return an ARRAY (attribute=FALSE) but
also a STRING (attribute=TRUE). adding this argument would not affect
older or current implementations or usage of the function file().
what do you think about this?
best regards, urs
--
Urs Gehrig <urs@circle.ch>
http://www.circle.ch
--
PHP Development Mailing List <http://www.php.net/>
To unsubscribe, e-mail: php-dev-unsubscribe@lists.php.net
For additional commands, e-mail: php-dev-help@lists.php.net
To contact the list administrators, e-mail: php-list-admin@lists.php.net