title: Trim leading white space with PHP?
body: <p>There seems to be a bug in a Wordpress PHP function that leaves whitespace in front of the title of the page generated by <code>&lt;?php echo wp_title(''); ?&gt;</code>  I've been through the Wordpress docs and forums on that function without any luck.</p>
  
  <p>I'm using it this way <code>&lt;body id="&lt;?php echo wp_title(''); ?&gt;"&gt;</code> in order to generate an HTML body tag with the id of the page title.</p>
  
  <p>So what I need to do is strip that white space, so that the body tag looks like this <code>&lt;body id="mypage"&gt;</code>  instead of this <code>&lt;body id="  mypage"&gt;</code></p>
  
  <p>The extra white space kills the CSS I'm trying to use to highlight menu items of the active page. When I manually add a correct body tag without the white space, my CSS works.</p>
  
  <p>So how would I strip the white space?  Thanks, Mark</p>
  
  <hr>
  
  <p>Part Two of the Epic</p>
  
  <p>John, A hex dump was a good idea; it shows the white space as two "20" spaces. But all solutions that strip leading spaces and white space didn't.</p>
  
  <p>And,  <code>&lt;?php ob_start(); $title = wp_title(''); ob_end_clean(); echo $title; ?&gt;</code></p>
  
  <p>gives me <code>&lt; body id =""&gt;</code></p>
  
  <p>and <code>&lt;?php ob_start(); $title = wp_title(''); echo $title; ?&gt;</code></p>
  
  <p>gives me <code>&lt; body id ="  mypage"&gt;</code></p>
  
  <p>Puzzle. The root of the problem is that wp_title has optional page title leading characters - that look like chevrons - that are supposed to be dropped when the option is false, and they are, but white space gets dumped in.</p>
  
  <p>Is there a nuclear option?</p>
  
  <hr>
  
  <p>Yup, tried them both before; they still return two leading spaces...  arrgg</p>