Field value as Views 3 block title I have a Views 3 block whose block title I would like to set using PHP in the header section. This would enable me to use tokens from the views results, which is not possible from the UI.

In the case of a views page I was able to set the page title via the following PHP command in the header section:

$view = views_get_current_view();
$view->build_info['title'] = 'My Page Title';


However, I was not able to do the same thing for block titles via

$view = views_get_current_view();
$view->build_info['title'] = 'My Block Title';


This is probably because the build_info['title'] command only edits the page (or node) title. Does anyone know of an analogous command to set block titles?
Sorry, I made a huge mistake. When I tried to achieve the same thing for the block title, I copied the code from the page header but didn't remove it from the page header. In other words, I used the PHP commands - exactly as described in the question - in the headers of two subviews of the same view simultaneously. To be more precise, the variable $view was used in two places, which caused an error.

When I replace $view = views_get_current_view();
$view->build_info['title'] = 'My Block Title'; with $view_block = views_get_current_view();
$view_block->build_info['title'] = 'My Block Title'; things work as desired!