title: (file_get_contents) get all variables instant
body: <pre><code>&lt;?php
  
  $text = file_get_contents('http://127.0.0.1/text.php');
  
  $start = '&lt;span class="ip"&gt;';
  $end = '&lt;/span&gt;';
  
  $start_p = strpos($text, $start);
  $end_p = strpos($text, $end);
  
  $text_p = $end_p - $start_p;
  
  $cut = substr($text, $start_p, $text_p);
  $cut = str_replace($start,"",$cut);
  
  $msg = $cut;
  
  echo $msg;
  
  ?&gt; 
  </code></pre>
  
  <p>text.php:</p>
  
  <pre><code>&lt;?php
  &lt;span class="ip"&gt;11.11.11.11&lt;/span&gt;
  &lt;span class="ip"&gt;22.22.22.22&lt;/span&gt;
  &lt;span class="ip"&gt;33.33.33.33&lt;/span&gt;
  &lt;span class="ip"&gt;44.44.44.44&lt;/span&gt;
  &lt;span class="ip"&gt;55.55.55.55&lt;/span&gt;
  &lt;span class="ip"&gt;66.66.66.66&lt;/span&gt;
  ?&gt;
  </code></pre>
  
  <p>I want to get all possible variables starting <code>&lt;span class="ip"&gt;</code> and ending with<code>&lt;/span&gt;</code>. With this script i managed to get only one variable that is 11.11.11.11. Any ideas how to output all of them instant? Thx for any help.</p>