$cookies = 'remixmid=123456; remixemail=mail%40mail.ru; remixpass=password'; preg_match('/remixmid=(\d+);/i',$cookies, $id); echo $id[1];