You probably only need [man]parse_url/man in conjunction with [man]parse_str/man.
EDIT:
For example:
<?php
$url = 'http://www.vbulletin.org/forum/showthread.php?t=198928&8384';
parse_str(parse_url($url, PHP_URL_QUERY), $query_string);
echo htmlspecialchars($query_string['t']);