i want to take this:

Label: Supreme Records
Catalog#: S 512
Format: Vinyl, 7"
Country: Belgium
Released: 1972
Genre: Rock
Style: Pop Rock
Credits: Producer - Gus Dudgeon
Notes:
Rating: No votes yet. Rate It
Submitted by: Evilist

from the site : http://www.discogs.com/release/479714


pls show me how to code it

Member Avatar for iamthwee

Access the html, and then use regular expressions to pick out the stuff you want.

First of all , you must get the hole html content of the page in an array.U can do that with the file() function an example :

$arr=file('http://www.yahoo.com');

Grabs all the content found on yahoo.com.
Next you must reach to the area which you want.Use a for loop to get from line to line , an example :

foreach ($arr as $key => $line)

Then you must find an upper bound and lower bound of the part you want. The upper/lower bound can be everything,with the condition that they are unique so you can reference them(ex: an html element with and id attribute , a image that only appears once...)
A way you can do that is with strstr() function.
After,you need to store the info in a variable

if (strstr($line, "upperbound"))
        $content .= $line;

This about it , you now just need to stop the grabing of info in the $content variable with the lowerbound condition and to strip the html tags (strip_tags($content))

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.