Req #64183 [Opn->Fbk]: Why no str_PUTcsv()?
| From: | cmb@php.net | Date: | Thu, 09 Sep 2021 11:03:13 +0000 |
| Subject: | Req #64183 [Opn->Fbk]: Why no str_PUTcsv()? | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-236484@lists.php.net to get a copy of this message | ||
Edit report at https://bugs.php.net/bug.php?id=64183&edit=1
ID: 64183
Updated by: cmb@php.net
Reported by: cstdenis at ctgameinfo dot com
Summary: Why no str_PUTcsv()?
-Status: Open
+Status: Feedback
Type: Feature/Change Request
Package: Strings related
Operating System: n/a
PHP Version: 5.4.11
-Assigned To:
+Assigned To: cmb
Block user comment: N
Private report: N
New Comment:
> Yes, the PHP language need this feature ! :-)
Why? Just for the sake of providing a (possibly reasonable)
counterpart to an unreasonable str_getcsv() isn't a proper
argument. Can anyone provide a use case where str_fputscsv()
would be helpful?
Previous Comments:
------------------------------------------------------------------------
[2017-09-27 14:11:51] cmb@php.net
function str_putcsv(
array $fields,
string $delimiter = ',',
string $enclosure = '"',
string $escape_char = '\\'
) {
$stream = fopen('php://memory', 'w+');
fputcsv($stream, $fields, $delimiter, $enclosure, $escape_char);
rewind($stream);
return stream_get_contents($stream);
}
------------------------------------------------------------------------
[2013-02-13 22:17:19] sunseb at live dot com
Yes, the PHP language need this feature ! :-)
------------------------------------------------------------------------
[2013-02-10 12:37:04] cstdenis at ctgameinfo dot com
Description:
------------
There is a fgetcsv(), fputcsv(), str_getcsv(), but str_putcsv() is missing.
------------------------------------------------------------------------
--
Edit this bug report at https://bugs.php.net/bug.php?id=64183&edit=1