Hello, On my site I have: <div style="visibility: visible; height: 250px;" class="alignR" id="google_companion_ad_div"></div> HTML: and want to replace it with: <a href="/here.php">Here</a> HTML: What is the PHP code I can use? Thank You
Use: $actual='<div style="visibility: visible; height: 250px;" class="alignR" id="google_companion_ad_div"></div>'; $after='<a href="/here.php">Here</a>'; str_replace($actual,$after,$html4strict_code); Where: $html4strict_code is the code containing whole HTML code.
But if it's on your site.. then why don't you just change the html? search and replace adds overhead.