severndigital Posted July 23, 2009 Share Posted July 23, 2009 I have an XML reponse from a server using fsockopen(). the response includes the headers, which I don't need. what is the easiest way to remove all the of the content before the <?xml chars?? Thanks, -P Quote Link to comment Share on other sites More sharing options...
severndigital Posted July 23, 2009 Author Share Posted July 23, 2009 FIgured it out. here it is for anyone else probably not the cleanest way .. but it's working //removing evertything before the <?xml $headers = substr($string,0,stripos($string,"<?xml")); $string = str_replace($headers,'',$string); //then we remove anything after the last > just to be safe. $string = substr($string,0,(strrpos($string,">")+1)); Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.