I have the following function:
function get_string_between($string, $start, $end){
$string = " ".$string;
$ini = strpos($string,$start);
if ($ini == 0) return "";
$ini += strlen($start);
$len = strpos($string,$end,$ini) - $ini;
return substr($string,$ini,$len);
}
I passing in the following information over to this function:
$result = scraped HTML page;
$name = get_string_between($result, '<div class="model ww"> ',' </div>');
$name= strtok($name, "\n");
I expect the following results:
$name = 'XM1014 | Bone Machine (Well-Worn)';
The whole section is as follows:
<div class="modal ww"> XM1014 | Bone Machine (Well-Worn) </div>