How to retrieve substrings using PHP
<p>I am trying to figure out how to pull a few substrings out of a string that I don't have any control of. The string contains 3 pieces of information I need. They are:</p>

<pre><code>Order #
Middle Digits
CV2 Number
</code></pre>

<p>Each of these pieces of information are a variable length. For example, in the string below, the order number is 2, but it could very well be 20 or 200, or 20174, or whatever. The middle digits could be 8 numbers or 2 numbers, etc. and the CV2 number could be 3, 2 or 1 number...</p>

<pre><code>Here are the middle digits of the card number for order #2:

Middle Digits: 11111111

And here is the CV2 number:

CV2 Number: 444
</code></pre>

<p>In the above example string, I need to get the order number (2), the middle digits (11111111) and the CV2 number (444). These numbers have an arbitrary length or might not exist at all.</p>

<p>What PHP functions/logic can help me retrieve these values reliably? The only information I need are the numbers.</p>

<p>Thank you!</p>
