How can I convert the following link below using PHP $_SERVER or something similar?
'../members/' . urlencode($user_id) . '/images/thumbs/' . $avatar;
How can I convert the following link below using PHP $_SERVER or something similar?
'../members/' . urlencode($user_id) . '/images/thumbs/' . $avatar;
Your question is somewhat unclear, but I think this may be what you are looking for.
$_SERVER['REQUEST_URI'];
This will give you everything in the url after the domain name.
Eg: If you request http://domain.com/sites/test/one.html
This will return /sites/test/one.html
If I understand, you want a complete URL:
$myUrl = $_SERVER['SERVER_NAME'] . '/members/' . urlencode($user_id) . '/images/thumbs/' . $avatar;
echo "<a href='" . $myUrl . "'>" . $myUrl . "</a>";