I\'m currently using this HTML DOM PARSER using php : http://simplehtmldom.sourceforge.net/
I\'m confused on how to remove and replace the selected attribute h
$html = str_get_html($string);
if ($html){ // Verify connection, return False if could not load the resource
$e = $html->find("a");
foreach ($e as $e_element){
$old_href = $e_element->outertext;
// Do your modification in here
$e_element->href = affiliate($e_element->href); // for example I replace original link by the return of custom function named 'affiliate'
$e_element->href = ""; //remove href
$e_element->target .= "_blank"; // I added target _blank to open in new tab
// end modification
$html = str_replace($old_href, $e_element->outertext, $html); // Update the href
}