- preg_replace: documentation ( source)
<?php
$str="HTTP/1.1 200 OK
Cache-Control: private
Transfer-Encoding: chunked
Content-Type: text/abo
Server: Microsoft-IIS/7.5
content-disposition: attachment; filename=_07412052_140822_140904.gpc
X-Powered-By: ASP.NET
X-UA-Compatible: IE=edge,chrome=1
Strict-Transport-Security: max-age=2592000; includeSubDomains
X-XSS-Protection: 1; mode=block
X-Frame-Options: sameorigin
Frame-Options: sameorigin
Date: Thu, 04 Sep 2014 19:03:29 GMT";
$pattern="/.*content-disposition: attachment; filename=(.+)gpc.*/";
$replace="$1";
echo preg_replace($pattern, $replace, $str);
?>