$mda = get_headers('http://mail.ru'); foreach($mda as $v){ if(stristr($v, 'Set-Cookie')){ $s .= $v."\n"; } } echo $s;