Rahul Rahul - 1 year ago 84
PHP Question

PHP to get element from link

I have below code:-

$link = 'http://www.domain.com/go.php?id=545&url=http://www.example.com/about


I want URL element that is - http://www.example.com/about

Answer Source
$link = 'http://www.domain.com/go.php?id=545&url=http://www.example.com/about';

$url = explode("&url=", $link)[1];
echo $url; //http://www.example.com/about
Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download