handbook/internal-api/wp-cli-utils-write-csv.md
github-actions[bot] c22aa665e6 Regenerate handbook
2025-12-17 18:56:32 +00:00

2.1 KiB

WP_CLI\Utils\write_csv()

Write data as CSV to a given file.


Usage

WP_CLI\Utils\write_csv( $fd, $rows, $headers = [] )
$fd (resource) File descriptor.
$rows (array<string[]>|iterable) Array of rows to output.
$headers (array<string>) List of CSV columns (optional).

Internal API documentation is generated from the WP-CLI codebase on every release. To suggest improvements, please submit a pull request.