function drush_key_value_to_array_table

8.0.x drush_key_value_to_array_table($keyvalue_table, $metadata = array())
6.x drush_key_value_to_array_table($keyvalue_table, $metadata = array())
7.x drush_key_value_to_array_table($keyvalue_table, $metadata = array())
3.x drush_key_value_to_array_table($keyvalue_table)
4.x drush_key_value_to_array_table($keyvalue_table)
5.x drush_key_value_to_array_table($keyvalue_table)
master drush_key_value_to_array_table($keyvalue_table, $metadata = array())

Convert an associative array of key : value pairs into a table suitable for processing by drush_print_table.


$keyvalue_table: An associative array of key : value pairs.

Return value

An array of arrays, where the keys from the input array are stored in the first column, and the values are stored in the third. A second colum is created specifically to hold the ':' separator.

3 calls to drush_key_value_to_array_table()
drush_core_status in commands/core/
Command callback. Provides a birds-eye view of the current Drupal installation.
drush_core_watchdog_show_one in commands/core/
Print a watchdog message.
drush_pm_info in commands/pm/
Command callback. Show detailed info for one or more projects.


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


function drush_key_value_to_array_table($keyvalue_table) {
  $table = array();
  foreach ($keyvalue_table as $key => $value) {
    if (isset($value)) {
      $table[] = array($key, ' :', $value);
    else {
      $table[] = array($key . ':', '', '');
  return $table;