title: Choosing what tab a user is on, accross multiple pages
body: <p>I am currently creating a website with tabs.</p>
  
  <p><a href="http://imageshack.us/photo/my-images/16/chosentab.png/" rel="nofollow">http://imageshack.us/photo/my-images/16/chosentab.png/</a> (It wont let me embed the image)</p>
  
  <p>As you can see, there is a tab, called classPvP that is selected, and it is done so by adding a "<strong>selected</strong>" in the tag's class.
  However, this website is going to be like a wiki, and as such have many different pages, and I don't want to have to create a seperate 'template' (if you will) for every page with a different selected tab, because then updating or changing something across all those templates would be very difficult.</p>
  
  <p>I am trying to use this code to add in the desired class when you have chosen a tab:</p>
  
  <pre><code>&lt;?php
  //Defining the variables
  $a="[[*menutitle]]";
  if ($a=="classpvp"){
  echo "selected";
  } else {
  echo $a;
  } ?&gt;
  </code></pre>
  
  <p>With the CMS (MODx) I'm using, <strong>[[*menutitle]]</strong> is replaced by whatever tab I want to have'selected'. However, for some reason, the if statement is not being run, but the echo is outputting that the value of $a is <strong>classpvp</strong> .</p>
  
  <p>This is seriously confusing me, as to why the if statement isn't being run, yet the value is correct - Am I storing something poorly?
  (Sorry, I'm very new to PHP)</p>
  
  <p>(Keeping in mind that <strong>[[TabSelectClassPvP]]</strong> is replaced with the php code)
  When used var_dump($a) (as suggested), the class turns from :</p>
  
  <pre><code>&lt;li class="navTab [[TabSelectClassPvP]]"&gt;
  ClassPvP
  &lt;/li&gt;
  </code></pre>
  
  <p>to:</p>
  
  <pre><code>&lt;li class="navTab string(14) " classpvp"=""&gt;
  ClassPvP
  &lt;/li&gt;
  </code></pre>
  
  <p>The exact php code being run is:</p>
  
  <pre><code>&lt;?php
  //Defining the variables
  $a="[[*menutitle]]";
  var_dump($a);
  if ($a=="classpvp"){
  echo "selected";
  } else {
  echo $a;
  }
  </code></pre>
  
  <p>Thanks,
  Muffinjello</p>
  
  <p>P.S. -
  I'm open to new ways of doing this, maybe something that retrieves information from an HTML ID? </p>