Hi,
I want to get 2 items of text from another website (with permission from the owner) and save them into a database on my server.
I'd like to know the best way (possibly give examples?) of getting the 2 text items...
The 2 items I want are as follows (everything is always the same apart from the 'number_here', which is the part I want):
<a href="/d/graph120.html" class="menu">number_here</a>
and
<a href="/d/graph132.html" class="menu">number_here</a>
I just want the number_here parts put into 2 variables $grab1 and $grab2, and not the rest.
Any assistance would be great.
Get text from another website
Moderator: General Moderators
use [php_man]curl[/php_man] to fetch the page, and use [php_man]preg_match[/php_man] to match whatever you need.
If you don't know how to write correct regular expressions, you can always exercise at http://www.samuelfullman.com/team/php/t ... ster_p.php
I think this is more valuable than pre-chewing the answer for you
If you don't know how to write correct regular expressions, you can always exercise at http://www.samuelfullman.com/team/php/t ... ster_p.php
I think this is more valuable than pre-chewing the answer for you