title: Codeigniter if else uri segment double if
body: <p>I have codeigniter code and want to create url if else using uri segment, fir first line it working well, but i have trouble for second line to hide segment 2 for this url</p>
  
  <p>i want to make if url is domain.com/favorite will display true, domain.com/favorite/me will display false, and else is false
  <div class="snippet" data-lang="js" data-hide="false">
  <div class="snippet-code">
  <pre class="snippet-code-html lang-html prettyprint-override"><code> &lt;?php
      if ($this-&gt;uri-&gt;segment(1) == "favorite") 
      {
          echo "True";
      }
      elseif ($this-&gt;uri-&gt;segment(1,2) == "favorite/me")
      {
          echo "False";
      }
      else
      {
          echo "false";
      }
  ?&gt;</code></pre>
  </div>
  </div>
  </p>