Australia's Leading Digital Marketing Experts. T. 1300 235 433  |  Aggregation Enquires Welcome

Example Interest Rates: Home Loan Variable: 1.89% (1.9%*) • Home Loan Fixed: 1.84% (2.11%*) • Fixed: 1.84% (2.11%*) • Variable: 1.89% (1.9%*) • Investment IO: 2.05% (4.36%*) • Investment PI: 1.58% (2.72%*)

Force Links to Open in a New Window

Here's a very simple PHP function that will parse text and create links that will open in a new window.

1
<?php 
2
function beliefmedia_link_window($text) {
3
  $text = preg_replace('/<a (. ?)>/i', "<a target='_blank' rel="external noopener noreferrer">", $text);
4
 return $text;
5
}
6
 
7
$content = '<a href="http://www.beliefmedia.com/">This link</a> will open in a new window';
8
echo beliefmedia_link_window($content);

Download our 650-page guide on Finance Marketing. We'll show you exactly how we generate Billions in volume for our clients.

  AUS Eastern Standard Time (Connecticut)

  Want to have a chat?
 

Like this article?

Share on facebook
Share on Facebook
Share on twitter
Share on Twitter
Share on linkedin
Share on Linkdin
Share on pinterest
Share on Pinterest

Leave a comment