title: Checks if a string ends with a specific word in php?
body: <p>There are many questions like this question but I can not find exact answer.  And I am unfamiliar Regular Expresion topic.</p>
  
  <p>I wanted to know if <code>$variable</code> ends with "books".</p>
  
  <p>For example : </p>
  
  <pre><code>$variable = "some-historical-books". 
  </code></pre>
  
  <p>So, I will display books page if it ends with books.</p>
  
  <p>Thank you.</p>