title: Confused about use of dirname and rtrim - PHP code (OpenCart)
body: <p>I am trying to understand some piece of code.</p>
  
  <pre><code>define('HTTP_OPENCART', 'http://' . $_SERVER['HTTP_HOST'] . rtrim(rtrim(dirname($_SERVER['SCRIPT_NAME']), 'install'), '/.\\'). '/');
  </code></pre>
  
  <p>What I am unable to understand is:</p>
  
  <p>A) <a href="http://us3.php.net/manual/en/function.rtrim.php" rel="nofollow">rtrim</a>: According to PHP manual, rtrim function should only receive two parameters. I think the first one is <code>dirname($_SERVER['SCRIPT_NAME']</code><br>
  Which is the second one? This <code>/.\\</code> ??</p>
  
  <p>Is it possible to have that in the second parameter taking into account that the manual says <code>With .. you can specify a range of characters</code>  Please note it talks about two full stops (not one, as it is in the code). </p>
  
  <p>And what about the last part of the code? <code>'/'</code></p>
  
  <p>B) <a href="http://us3.php.net/manual/en/function.dirname.php" rel="nofollow">dirname</a>: According to PHP manual, this function should only receive one parameter which is (in my opinion), in this case, ($_SERVER['SCRIPT_NAME']). What is the meaning of <code>,'install'</code> over there?</p>
  
  <p>I am really confused. </p>