I have a bit of code, below, which connects to the server and then I send an xml command which causes the server to send me the requested data in xml format.
My issue is that when the fsockopen connection is made it sends some data back which results in this data being shown on the screen before the xml data.
Can anyone help me work out how to only return the xml data and ignore the initial connection data (which is not xml).
[php]$xml_data ="";
$ras = fsockopen($svr_add,$svr_port,$errno,$errstr,$svr_timeout);
fputs ($ras, $xml_data);
$ras1 = stream_get_contents($ras, -1, -1);
fclose($ras);
$xml = $ras1;
echo print_r($xml);[/php]
I have tried all sorts of things but my lack of experience and knowledge is holding me back!
Thanks in advance
Gordon