title: Take question mark off end of string in PHP
body: <p>I'm new to php, but wasn't able to find a straight answer online, so decided to ask Stack Overflow.</p>
  
  <p>I have a variable, and I want to make a statement similar to the following:</p>
  
  <pre><code>if ($var has a question mark at end)
  {
  $var = ($var - question mark)
  }
  </code></pre>
  
  <p>Thanks in advance!</p>
  
  <p>--EDIT--</p>
  
  <p>I ended up using the following:</p>
  
  <pre><code>if (substr($var, -1) == "?")
  {
  $var = rtrim($input, "?");
  }
  </code></pre>
  
  <p>Thanks again for the quick feedback. God I love this site.</p>
  
  <p>--END EDIT--</p>