title: Find variable substring in string with PHP
body: <p>I am about to start working on a project that requires me to do the following:</p>
  
  <ol>
  <li><p>load the source code of a webpage into a string with file_get_contents</p></li>
  <li><p>find a certain substring in the first string, that reads "Your code: 6-digit-number-here, with a dash after every 2 digits"</p></li>
  <li><p>save the first occurrence of the substring into a text file</p></li>
  <li><p>do the same for each occurrence of the substring in the string</p></li>
  </ol>
  
  <p>The 6-digit number is different for each occurrence in the source code. How do I define that number in the substring, so I can properly search for it, and how can I make it save every occurrence of the defined substring? Help would be greatly appreciated.</p>