hi all,

I have a scrap working but it also brings the restred trade mark.

I have permission from the company to do this.

How do i strip these out?

// get simple_html_dom from http://simplehtmldom.sourceforge.net/
include_once('simple_html_dom.php'); 


// @todo change $url for form input
$url = "";

$html = file_get_html($url);

// look for ul tags inside DIV with id ProductDetail
$ul = $html->find('div[id=ProductDetail] ul');
// look for h1 tags inside DIV with id ProductDetail
$h1 = $html->find('div[id=ProductDetail] h1');
// look for span tag with discription class inside DIV with id ProductDetail
$det = $html->find('div[id=ProductDetail] span[class=discription]');

foreach($h1 as $header1){
    echo $header1 ."<br/>";
}
foreach($det as $detail){
     echo $detail . "<br/>";
}
foreach($ul as $list){
    echo $list . "<br/>";
}

Recommended Answers

All 5 Replies

Member Avatar for LastMitch

@Squidge

I'm not sure what are you asking. Do you mean you want to get rid those tags and replace a new one?

@LastMitch

I want to get ride of them although they look to be embedded:

This is an example of the scrape:

supports Coreâ„¢ 2 Duo/Coreâ„¢ 2 Duo LV Processor F

This should read:

supports Core 2 Duo/Core 2 Duo LV Processor F

Member Avatar for LastMitch

@Squidge

supports Coreâ„¢ 2 Duo/Coreâ„¢ 2 Duo LV Processor F

I think you need to change the document's character encoding in "meta" tag.

Try to change "charset" value to utf-8 or something else.

Member Avatar for diafol

THis works for me:

$txt = 'Helloâ„¢Hello';

echo str_replace('â„¢','',$txt);

Diafol many thanks. Working like a charm

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.