title: Check if a String Ends with a Number in PHP
body: <p>I'm trying to implement the function below. Would it be best to use some type of regex here? I need to capture the number too.</p>
  
  <pre><code>function endsWithNumber($string) {
    $endsWithNumber = false;
  
    // Logic
  
    return $endsWithNumber;
  }
  </code></pre>