php如何从二进制数据中显示文件

I have function that run web-service and bring me binary file:

$params->xmlRequest = $paramsStr;

$result = $s->__call("SubmitXmlString",array($params));

$obj_pros = get_object_vars($result);
$xml =  $obj_pros['SubmitXmlStringResult']; 
$xml = simplexml_load_string($xml); 

return ($xml);  

example for response:

<PnrGetReportDoc ReportName="ExternalDocument">
    <Report ID="6214" Type="pdf" Name="file name" IsCompressed="1">
        <![CDATA[JVBERi0xLjcNCiW1tbW1DQoxIDAgb2JqDQo8PC9UeXBlL0NhdGFsb2cvUGFnZXMgMiAQolJU......................VPRg==]]>
        </Report>
    <ReportImages>
</ReportImages>
</PnrGetReportDoc>

I would like to ECHO the content in order to display the file

I tried to echo the binary but: 1. PDF isn't display

  1. binary characters start without the opening notes: <![CDATA[

This is my php file where i'm trying to display the file:

header('Content-type: application/'pdf);
$fileData = get_file_data ($_GET['fileID']);

echo $fileData->Report;

That is not binary. Precisely, XML is well known for being a plain text data format.

From the sample data you've shared I imagine it's Base64, a popular algorithm to encode binary data as plain text. PHP has a native function to decode it.