Wordpressor
Wordpressor

Reputation: 7543

The easiest way of getting data from different site

I want to grab static data from different website (URL and elements name provided), what's the easiest way?

www.address/articles/grab-this

<html>
   (...)
   <article id="#article-121">
     <h1>Header</h1>
     <p>Contents</p>
    </article>
   (...)
</html>

index.php

/* Grab "#article-121" from www.address/articles/grab-this */

   <article id="#article-121">
         <h1>Header</h1>
         <p>Contents</p>
   </article>

/* Close the connection */

Upvotes: 1

Views: 763

Answers (1)

Eruant
Eruant

Reputation: 1846

$contents = file_get_contents(url_goes_here);

Upvotes: 2

Related Questions