fork download
  1. <?php
  2.  
  3. $str = 'fix me <a href="www.link.com">link</a> or fix me <a href="link.com">link</a> and fix me too <a href="http://l...content-available-to-author-only...k.com">link</a> and replace me with <a href="http://w...content-available-to-author-only...k.com>link</a>';
  4. echo str_replace('www.www', 'www', str_replace('http://w...content-available-to-author-only...w.http://', 'http://www.', str_replace('a href="', 'a href="http://www.', $str)));
Success #stdin #stdout 0.01s 20568KB
stdin
Standard input is empty
stdout
fix me <a href="http://w...content-available-to-author-only...k.com">link</a> or fix me <a href="http://w...content-available-to-author-only...k.com">link</a> and fix me too <a href="http://w...content-available-to-author-only...k.com">link</a> and replace me with <a href="http://w...content-available-to-author-only...k.com>link</a>