Hey Wormy...ok...we're getting closer (I think)...still stuck though...
Now do I edit ANYTHING in the actual function OR do I just set my variables accordingly when I call the function?
Here's what I'm using as my function call:
$tracks_table = Get_String_Between_Strings($contents,"<br /><br />","<hr noshade size=1>", 1);
$contents is equal to the ENTIRE PAGE that is being read. (This might be messing up what's in the function? I'm not sure)
Here's an example page I'm trying to get data from:
http://www.amazon.com/exec/obidos/tg/detail/-/B000004286/
Any additional help to get me on the right path is appreciated. Thanks fro the help!
Here's the script:
function Get_String_Between_Strings ($contents, $starttag = ">", $endtag = "<", $number = FALSE) {
$matches = array ();
$starttag_length = strlen ($starttag);
//$contents = strtolower ($contents);
if (strstr ($contents, $starttag)) {
while (strstr ($contents, $endtag)) {
$contents = strstr ($contents, $starttag);
$contents = substr ($contents, $starttag_length);
$tostrip = strstr ($contents, $endtag);
$matches[] = str_replace ($tostrip, "", $contents);
}
}
if ($number) {
$slice = array_slice ($matches, 0, $number);
return ($slice);
} else {
return ($matches);
}
}