php test if string ends with _text + number
<p>I have a couple of issues with this if statement which checks if a string ends with "address".</p>

<p>E.g this matches <code>user_address</code>, <code>user_address1</code>, <code>user_address99</code>, etc. Which is correct. </p>

<p>The problem is that it also matches <code>user_address_location</code> which is not correct. </p>

<p>I only want this to match if:</p>

<ol>
<li>Is ends with _address</li>
<li>Also if it has a number on the end e.g _address2</li>
</ol>



<pre><code>/* Only establish an address field as ADDRESS if follows "user_address1" format */
if((stristr($column,"address") !== false)) {
    $parts = explode("_", $column);
    if (!empty($parts)) {
        // address code
    }
}
</code></pre>
