[thelist] php regexp help (or some other solution maybe..)

Tom Dell'Aringa pixelmech at yahoo.com
Tue Dec 31 09:43:01 CST 2002

Hello all,

I've got this continuing problem with this XML file that Carl gave me
some valuable help on. Anyway, we think the solution is to remove the
unwanted information that is probably causing the error before the
info is written to our file on the server. I assume regexp can be
used to do this, but maybe there is another way..anyway - here again
is what is being written to the file:
HTTP/1.1 200 OK
Date: Tue, 31 Dec 2002 01:04:46 GMT
Server: Apache/1.3.20 Sun Cobalt (Unix) Chili!Soft-ASP/3.6.2
mod_jk/1.1.0 mod_ssl/2.8.4 OpenSSL/0.9.6g PHP/4.1.2
mod_auth_pam_external/0.1 FrontPage/ mod_perl/1.25
Cache-Control: no-cache
Connection: close
Content-Type: text/xml

<?xml version="1.0"?>
<some xml>
I need to remove EVERYTHING before the xml declaration before I write
the file. My file writing code is very simple:

$filename = "dump.xml";
$handle = fopen($filename,'w+');
$string = $response;

//$string is set to $response, which is the info above. Here would be
the place to fix the info...

fputs($handle, $string);

I know nothing about regexp at all, maybe there is some other way to
remove the info? Any help is appreciated.



var me = tom.pixelmech.webDeveloper();

[Making A Commercial Case for Adopting Web Standards]

Do you Yahoo!?
Yahoo! Mail Plus - Powerful. Affordable. Sign up now.

More information about the thelist mailing list