Function __global->fputcsv

Definitions

sources_custom/phpstub.php

  • Format line as CSV and write to file pointer.
  • Visibility: public
  • Is abstract?: No
  • Is static?: No
  • Is final?: No

Parameters

Name Type Passed by reference? Variadic? Default Set Range Description
$handle resource No No required parameter N/A N/A File pointer
$fields array No No required parameter N/A N/A An array of values
$delimiter string No No , N/A N/A The optional delimiter parameter sets the field delimiter (one character only)
$enclosure string No No " N/A N/A The optional enclosure parameter sets the field enclosure (one character only)
$escape string No No \ N/A N/A Set the escape character (one character only)

Returns

  • The length of the written string (false: error)
  • Type: ~integer
  • Set: N/A
  • Range: N/A

Preview

Code (PHP)

/**
 * Format line as CSV and write to file pointer.
 *
 * @param  resource $handle File pointer
 * @param  array $fields An array of values
 * @param  string $delimiter The optional delimiter parameter sets the field delimiter (one character only)
 * @param  string $enclosure The optional enclosure parameter sets the field enclosure (one character only)
 * @param  string $escape Set the escape character (one character only)
 * @return ~integer The length of the written string (false: error)
 */

function fputcsv($handle, array $fields, string $delimiter = ',', string $enclosure = '"', string $escape = '\')