title: setAttribute isn't doing anything
body: <p>I have a PHP page. It is supposed to to get all of hrefs of links in the page and change them to something else, and then show the page. But it isn't doing that. Here is my code:</p>
  
  <pre><code>$returndata = file_get_contents($url);
  $doc= new DOMDocument(); 
  @$doc-&gt;loadHTML($returndata);
  foreach($doc-&gt;getElementsByTagName('a') as $anchor)
  {
          $href=$anchor-&gt;getAttribute('href');
          $splited=str_split($href);
          $hashed=implode("*",$splited);
          $anchor-&gt;setAttribute("href", $hashed);
  } 
  echo $returndata;
  </code></pre>
  
  <p>but the <code>setAttribute</code> isn't doing anything. Then I tried adding this before that:</p>
  
  <pre><code>$anchor-&gt;removeAttribute("href"); 
  </code></pre>
  
  <p>but there is no change.</p>