// note that strrpos() can only accept more than one char in php5$pos = strrpos('t=', $url);$pos = ($pos === false) ? strrpos('threadid=', $url) : $pos + 2;$pos = ($pos === false) ? false : $pos + 9;if ($pos !== false){ $threadid = substr($url, $pos);}