Suggest a feature
×

Welcome to TagMyCode

Please login or create account to add a snippet.
0
0
 
0
Language: PHP
Posted by: Dylan Lopez
Added: Mar 5, 2018 8:28 AM
Views: 9
  1. $html = str_get_html($data);
  2. $e = $html->find("a");
  3. foreach ($e as $e_element){
  4.     $e_element->href = add_affiliate_id($e_element->href); // do something in here
  5.     $e_element->target .= "_blank"; // open in new tab
  6.     $url .= $e_element->outertext;
  7. }
  8.  
  9. echo $html; // return modified data