I've included a file that should parse that URL for your.
I got this this snippet from a tutorial on Zend.com and some other website, I can't find the URL right now.
This should help you out.
Btw: it does use fopen();
just follow the code and you'll learn something. 🙂