CsvRcfWriter.php
8 years ago
CsvRfcUtils.php
4 weeks ago
CsvRfcWriteStreamFilter.php
8 years ago
CsvWriter.php
5 months ago
CsvRcfWriter.php
61 lines
| 1 | <?php |
| 2 | |
| 3 | /* |
| 4 | * AJGL CSV RFC Component |
| 5 | * |
| 6 | * Copyright (C) Antonio J. García Lagar <aj@garcialagar.es> |
| 7 | * |
| 8 | * For the full copyright and license information, please view the LICENSE |
| 9 | * file that was distributed with this source code. |
| 10 | */ |
| 11 | |
| 12 | namespace Wpae\Csv; |
| 13 | |
| 14 | class CsvRcfWriter |
| 15 | { |
| 16 | /** |
| 17 | * @see http://php.net/manual/en/function.fputcsv.php |
| 18 | * |
| 19 | * @param resource $handle |
| 20 | * @param array $fields |
| 21 | * @param string $delimiter |
| 22 | * @param string $enclosure |
| 23 | * @param string $escape |
| 24 | */ |
| 25 | public static function fputcsv($handle, array $fields, $delimiter = ',', $enclosure = '"', $escape = '\\') |
| 26 | { |
| 27 | CsvRfcUtils::fPutCsv($handle, $fields, $delimiter, $enclosure, $escape); |
| 28 | } |
| 29 | |
| 30 | /** |
| 31 | * @see http://php.net/manual/en/function.fgetcsv.php |
| 32 | * |
| 33 | * @param resource $handle |
| 34 | * @param array $length |
| 35 | * @param string $delimiter |
| 36 | * @param string $enclosure |
| 37 | * @param string $escape |
| 38 | * |
| 39 | * @return array|false|null |
| 40 | */ |
| 41 | public static function fgetcsv($handle, $length = 0, $delimiter = ',', $enclosure = '"', $escape = '"') |
| 42 | { |
| 43 | return CsvRfcUtils::fGetCsv($handle, $length, $delimiter, $enclosure, $escape); |
| 44 | } |
| 45 | |
| 46 | /** |
| 47 | * @see http://php.net/manual/en/function.str_getcsv.php |
| 48 | * |
| 49 | * @param string $input |
| 50 | * @param string $delimiter |
| 51 | * @param string $enclosure |
| 52 | * @param string $escape |
| 53 | * |
| 54 | * @return array |
| 55 | */ |
| 56 | public static function str_getcsv($input, $delimiter = ',', $enclosure = '"', $escape = '"') |
| 57 | { |
| 58 | return CsvRfcUtils::strGetCsv($input, $delimiter, $enclosure, $escape); |
| 59 | } |
| 60 | |
| 61 | } |