How can i grab a URL string right from PHP where the URL is actually redirected from another URL?

Example, I browse to h t t p://w w , and it is immediately redirected to h t t p://w w

Is there a way to grab the URL string 'http://w w' from PHP and store in a variable? With CURL?

In my real project, h t t p://w w will redirect to a flash object h t t p://w w

I just need to store the URL string like this

PHP Code:
$flash_obj 'http://w w'
and launch the flash object in my HTML page.

<embed src='<?php echo $flash_obj?>' ......>
Thank you!!