You are here

function sweaver_drush_array_lines_to_array_key_values in Sweaver 6

Same name and namespace in other branches
  1. 7 drush/sweaver.drush.inc \sweaver_drush_array_lines_to_array_key_values()

Convert a string to array.

Parameters

$array: A collection of key value pairs where the value should be exploded.

Return value

$array Array with keys and values from the values of the input array.

1 call to sweaver_drush_array_lines_to_array_key_values()
sweaver_drush_edit_style in drush/sweaver.drush.inc
Edit a style.

File

drush/sweaver.drush.inc, line 463
Sweaver Drush functions.

Code

function sweaver_drush_array_lines_to_array_key_values($array) {
  $new_array = array();
  foreach ($array as $key => $line) {
    $key_value = explode(":", $line);
    $new_array_key = trim(array_shift($key_value));
    $new_array_value = trim(implode('', $key_value));
    $new_array[$new_array_key] = $new_array_value;
  }
  return $new_array;
}