I need to urlencode all links at an html-page.
I can isolate the links with:
$DataPrint[1] = preg_replace('/<a\s+.?href="(["]+)"[>]>([<]+)<\/a>/is','<a href="\1">\2</a>', $DataPrint[1]);
Then I would like to urlencode(\1), which is not possible.
Any suggestions?
Also totally different methodes to urlencode all links at a page is very welcome