WordPress at Your Fingertips
function is not described

WC_CSV_Exporter::implode_values() protected WC 3.2.0

Implode CSV cell values using commas by default, and wrapping values which contain the separator.

{} It's a method of the class: WC_CSV_Exporter{}

No Hooks.

Return

String.

Usage

// protected - for code of main (parent) or child class
$result = $this->implode_values( $values );
$values(array) (required)
Values to implode.

Changelog

Since 3.2.0 Introduced.

Code of WC_CSV_Exporter::implode_values() WC 5.9.0

protected function implode_values( $values ) {
	$values_to_implode = array();

	foreach ( $values as $value ) {
		$value               = (string) is_scalar( $value ) ? $value : '';
		$values_to_implode[] = str_replace( ',', '\\,', $value );
	}

	return implode( ', ', $values_to_implode );
}