You are here

function sweaver_drush_array_to_string in Sweaver 6

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

Convert an array to string.

Parameters

$array: A collection of key value pairs.

Return value

$string String with on each line a key: value pair from the input array.

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

File

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

Code

function sweaver_drush_array_to_string($array) {
  $string = '';
  if (is_string($array)) {
    $array = unserialize($array);
  }
  if (is_array($array) && !empty($array)) {
    foreach ($array as $key => $value) {
      $string .= "{$key} : {$value}\n";
    }
  }
  return $string;
}