SamA74,
Iāll put words in your mouth:
Nice Try UI. 
Hereās a code sample you asked for. Let me know what you think.
<?php
$url = "http://google.com";
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, "$url");
curl_setopt($ch, CURLOPT_FOLLOWLOCATION, TRUE);
curl_setopt($ch, CURLOPT_HEADER, 5);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, TRUE);
$result = curl_exec($ch);
echo preg_replace_callback(
'#https?://[^\s\'"]+#',
function($matches) {
return 'http://mydomain.com/tracker.php?'.urlencode($matches[0]);
},
$result
);
?>
The above regex can precede the tracker link onto all links (absolute and relative links) found on the cURL fetched page.
So, an absolute link that originally looks like this:
https%3A%2F%2Fplus.google.com%2F116899029375914044550
is now shown as this by cURL:
http://mydomain.com/tracker.php?https%3A%2F%2Fplus.google.com%2F116899029375914044550
So far, so good.
But an absolute link that looks like this:
/intl/en/ads/
is getting shown by cURL like this:
http://localhost/intl/en/ads/
So the regex is preceding the tracker url on all links present on the cURL fetched page alright but it is not replacing the ālocalhostā part.
Now, I need to add another line of code to replace the ālocalhostā on relative links with the current pageās domain name. That is 2 sets of code. Would be better, if one regex did both tasks. And that is, precede the tracker url onto relative links by replacing the ālocalhostā. Is this possible ?
Anyway, an idea has popped into my mind.
How-about you guys (seniors) with fair experience (and when you have the time or when youāre feeling bored and need to do something interesting to pass time rather than go to the bar, eg. like weekends), build code puzzles (in a āpuzzle solving threadā) from time to time and see who can solve it.
This is where you write the codes for a specific task and then leave a few gaps for newbies to fill-in. As a sort of a test. Would be a great learning exercise. I reckon even intermediate and pro people would join in. 
I might aswell contribute a little and build some of my own for my juniors to play with.
You know. No-one really knows it all. Even the intermediate and adv guys might find-out that theyāve learnt or understood something wrong and learn a little. Just one way for their errors to be caught. Isnāt there some sort of a saying that, the teacher becomes more expert when he starts teaching as he learns from his own teaching or from the feedback he gets from his students. Or, whatever.
I think it is a good idea. As I learn along, I can build puzzles after I finish each chapter. New newbies can do the same. Oldbies can come and check now and then how the newbies are fairing. Iām gonna have this topic at the back of my head (subconscious) and try building on the idea. The puzzle ghost has entered my head now and it aināt going anytime soon.
Anyway, back to the topic.