Jump to content

Opening 2 Websites | Easy


Stotty

Recommended Posts

<?php

 

$ch = curl_init("http://www.example.com/");

$fp = fopen("example_homepage.txt", "w");

 

curl_setopt($ch, CURLOPT_FILE, $fp);

curl_setopt($ch, CURLOPT_HEADER, 0);

 

curl_exec($ch);

curl_close($ch);

fclose($fp);

?>

 

 

Thats the code

 

If i wanted to open a div " <div class=""newsTitle""> " from runescape.com how would i do that

 

Cheers

In Advanced

Once you've run the curl functions you should have a variable with the page content assigned. You can then use a function (like a regex string replace function) to only get the content you want from the page. I recommend taking that question to the regex past of the forum.

 

If we look at it literally you'll be saying find everything between the open and close div tags with a class of newsTitle.

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.