I have some basic HTML which I am calling str_replace()
on, I need to append all URLs found within an HTML string with a 'generate_book.php?link=
', but I need to exclude any external links, eg;
<a href="gst/3.html">Link</a>
-- this should become -- <a href="generate_book.php?link=gst/3.html"></a>
<a href="http://example.com">Link</a>
-- this should be left alone
Your brain powa is appreciated!