How to wrap first word of page title in span in drupal 7 I want to implement it with theme_preprocess function. Every my attempt fails.

function mdrupal_mono_preprocess_page(&amp;$variables) {
  $variables['title'] = drupal_get_title($variables['node']);
  $title = $variables['title'];
  if($title) {
    $words = explode(' ', $title);
    $words[0] = '&lt;span&gt;' . $words[0] . '&lt;/span&gt;';
    $title = implode(' ', $words);
  }
}
Not really a Drupal question, but you're setting the wrong variable

$title = implode(' ', $words);


should be

$variables['title'] = implode(' ', $words);


Or, change

$title = $variables['title'];


to 

$title = &amp;$variables['title'];


instead. Either will work