php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Request #64183 Why no str_PUTcsv()?
Submitted: 2013-02-10 12:37 UTC Modified: 2017-09-27 14:11 UTC
Votes:29
Avg. Score:4.2 ± 0.8
Reproduced:25 of 25 (100.0%)
Same Version:10 (40.0%)
Same OS:15 (60.0%)
From: cstdenis at ctgameinfo dot com Assigned:
Status: Open Package: Strings related
PHP Version: 5.4.11 OS: n/a
Private report: No CVE-ID: None
Have you experienced this issue?
Rate the importance of this bug to you:

 [2013-02-10 12:37 UTC] cstdenis at ctgameinfo dot com
Description:
------------
There is a fgetcsv(), fputcsv(), str_getcsv(), but str_putcsv() is missing. 


Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2013-02-13 22:17 UTC] sunseb at live dot com
Yes, the PHP language need this feature ! :-)
 [2017-09-27 14:11 UTC] 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);
}
 
PHP Copyright © 2001-2019 The PHP Group
All rights reserved.
Last updated: Fri Dec 13 05:01:26 2019 UTC