title: PHP preg_match with file_get_contents
body: <p>I have a text on a page and I want to get if to other page by using 
  <code>preg_match</code> and <code>file_get_content</code> functions</p>
  
  <p>the text on <code>page1.php</code> is  </p>
  
  <pre><code>return(["h","t","t","p",":","\/","\/","1","7",".","2","4","8",".","1","7","4",".","3","8",":","8","0","8","1","\/"])
  </code></pre>
  
  <p>i want to get the text from <code>page1.php</code> to <code>page2.php</code> like this</p>
  
  <p>The IP is : <a href="http://17.248.174.38:8081/" rel="nofollow noreferrer">http://17.248.174.38:8081/</a></p>
  
  <p>the IP is automatically now is 17.248.174.38:8081, after refresh can became 133.213.171.33:8081 so it's generated from page1</p>
  
  <p>I tried this code but it not working</p>
  
  <pre><code>   &lt;?php
      $url = "http://localhost/page1.php";
      $contents = file_get_contents($url);
      preg_match('/(http?\:\/\/[^\']*\.8081*)/', $contents, $result);
      $link = urldecode($result[0]);
      $echo "The IP is :" $link;
      ?&gt;
  </code></pre>
  
  <p>any help please, I'm just beginner in php </p>
  
  <p>the IP 17.248.174.38 can be changed on any time a refresh the page</p>
  
  <p>thanks</p>