function _convert_csv_to_array

8.0.x _convert_csv_to_array($args)
6.x _convert_csv_to_array($args)
7.x _convert_csv_to_array($args)
4.x _convert_csv_to_array($args)
5.x _convert_csv_to_array($args)
master _convert_csv_to_array($args)

Convert a csv string, or an array of items which may contain csv strings, into an array of items.

@returns array A simple list of items (e.g. array('a','b','c')


$args: A simple csv string; e.g. 'a,b,c' or a simple list of items; e.g. array('a','b','c') or some combination; e.g. array('a,b','c') or array('a,','b,','c,')

10 calls to _convert_csv_to_array()
core_cli_bashrc in commands/core/
drush_pm_disable in commands/pm/
Command callback. Disable one or more extensions.
drush_pm_download in commands/pm/
Command callback. Download Drupal core or any project.
drush_pm_enable_validate in commands/pm/
Validate callback. Determine the modules and themes that the user would like enabled.
drush_pm_info in commands/pm/
Command callback. Show detailed info for one or more extension.

... See full list


includes/, line 322
The drush API implementation and helpers.


function _convert_csv_to_array($args) {
  // Step 1: implode(',',$args) converts from, say, array('a,','b,','c,') to 'a,,b,,c,'
  // Step 2: explode(',', ...) converts to array('a','','b','','c','')
  // Step 3: array_filter(...) removes the empty items
  return array_filter(explode(',', is_array($args) ? implode(',', $args) : $args));