wc_string_to_array( string $string, string $delimiter = ',' )
Explode a string into an array by $delimiter and remove empty values.
Description Description
Parameters Parameters
- $string
-
(Required) String to convert.
- $delimiter
-
(Optional) Delimiter, defaults to ','.
Default value: ','
Return Return
(array)
Source Source
File: includes/wc-formatting-functions.php
function wc_string_to_array( $string, $delimiter = ',' ) { return is_array( $string ) ? $string : array_filter( explode( $delimiter, $string ) ); }
Changelog Changelog
Version | Description |
---|---|
3.0.0 | Introduced. |