I could not find an optimal solution for this problem. The idea is to change all the urls of a text containing a specific domain with a preg_replace_callback() to base 64 codification. The urls are of this type: http://www.domain.com/?fsdf76sf8sf6fds and separately the other way: http://www.otherdomain.com/file/CA60D10F8ACF7CAA
any ideas for the regex?
What you are looking for is something along the lines of
That regular expression may be a bit confusing, so let’s break it down:
A very simple system to test stuff like this:
(should you already be unit testing, use that instead, obviously…)