One of the big problems with render arrays is that there are often a bunch of read-only copies of the information that you're looking for. If you want to actually change the render output, you have to find the right one. I usually use dpm(), and then view page source and search through the output there, flipping back and forth between the two displays until I find what I need.
If you want to dump the contents of a render array for a given path to the terminal (e.g. to pass it through grep), you could do something like this:
drush ev '$router_item=menu_get_item("node/7"); require_once(DRUPAL_ROOT .
"/" . $router_item["include_file"]);
$render_array=call_user_func_array($router_item["page_callback"],
$router_item["page_arguments"]); print_r($render_array);'
You could also just 'view page source' in your browser and use the clipboard, of course, but the above might be the start of a Drush command to view render arrays.
Update: I found a really good article on this subject: The Scary Render Array -- probably the best treatment of render arrays I have seen so far. I should have also mentioned the devel_themer module upfront; it does a good job at "zooming in" on the section of the render array you are interested in.
dpm()
, I think he's looking for a function to find a sub-element within a render array by a given name/key – Clive♦ Apr 12 '12 at 8:21$elements = find_elements_by_key($render_array, 'element_name');
to return an array of all of the elements in the render array with a matching key? – Clive♦ Apr 12 '12 at 8:23