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.

Related topics

6 calls to drush_key_value_to_array_table()
drush_core_shell_alias in commands/core/
Print out the specified shell aliases.
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 extensions.
drush_xkcd_display in examples/
Retrieve and display a table of metadata for an XKCD cartoon, then retrieve and display the cartoon using a specified image viewer.

... See full list


includes/, line 249


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;