WC_Product_Importer::explode_values( string $value, string $separator = ',' )

Explode CSV cell values using commas by default, and handling escaped separators.


Description Description


Parameters Parameters

$value

(Required) Value to explode.

$separator

(Optional) Separator separating each value. Defaults to comma.

Default value: ','


Top ↑

Return Return

(array)


Top ↑

Source Source

File: includes/import/abstract-wc-product-importer.php

	protected function explode_values( $value, $separator = ',' ) {
		$value  = str_replace( '\\,', '::separator::', $value );
		$values = explode( $separator, $value );
		$values = array_map( array( $this, 'explode_values_formatter' ), $values );

		return $values;
	}

Top ↑

Changelog Changelog

Changelog
Version Description
3.2.0 Introduced.

Top ↑

User Contributed Notes User Contributed Notes

You must log in before being able to contribute a note or feedback.