title: How to find the end of a word using strpos()
body: <p>I'm getting an address input as one long string as opposed to name, address, city, state and zip. I split most of it up, besides for between the address and the city. So I want to search for any street type name (court, road, street, avenue, etc) and then split the string at the end of the word. Then I will be left with the address and city separate. </p>
  
  <p><code>strpos()</code> only gives me the position of the <strong>beginning</strong> of the keyword, I want it to split at the <strong>end</strong> of the keyword. 
  For example this is where I'm up to:</p>
  
  <pre class="lang-none prettyprint-override"><code>John Doe
  1 Main Street Anytown
  NY
  00000
  </code></pre>
  
  <p>I want to split between <code>Street</code> and <code>Anytown</code>. And this address won't be static, there may be more words etc.</p>
  
  <p>Another idea would be a function that automatically splits a string into different fields. Someone told me that in some countries the postal service has an API that does it. Does USPS have such a thing? Their site doesn't indicate it.</p>