How to print array in Drupal using drupal_set_message

Problem:
How to print array in Drupal using drupal_set_message

Solution:

drupal_set_message('<pre>'. print_r($array_or_object, TRUE) .'</pre>');

May 29, 2018