print $_SERVER['REQUEST_URI'].'<br>'; if (preg_match("/=([a-f0-9]{32})&/i", $_SERVER['REQUEST_URI'].'&')){ print 'Да'; // удалить сессию из строки параметров //print str_replace('&&','&',str_replace('?&','?',preg_replace("/&*sid=([a-f0-9]{32})&*/i", '&', $_SERVER['REQUEST_URI']))); } else print 'Нет';