Check if string contains only combinations of array elements (numbers and words)
<p>I've searched for hours and can't find any example of what I'm trying to do. I can't even figure out what php function needs to be used, but I'm thinking probably a regex. I attempted to use in_array and it didn't work. I don't know enough about regexes to even set up a test. Here's the problem... Say my array is:</p>

<pre><code>$sizeopts = array('0', '1', '2', '3', '4', '5', '6', '7', '8', '9', '.5',
 ' Wide', ' Narrow', 'XS', 'Small', 'Medium', 'Large', 'XL');
</code></pre>

<p>The textbox name is "size", and I want to only allow combinations of the above to be submitted. Example valid input: "10.5 Wide" or "3XL". Invalid input: "1X" or "2Wide" (missing the space in front of Wide). I have several different size arrays I need to validate. I'm not just using drop-downs because there are two many different possible combinations. Thanks for any help you can offer!</p>
