Html parsing problem

I have a html file whose content starts as below. I want to convert this html into an XML file. So first I need to eliminate the initial part i.e. TOC^TOC^-1^-1^,^-1^-1%

How can I do this.

TOC^TOC^-1^-1^,^-1^-1%<?xml version=“1.0” encoding=“utf-8”?>
<Order>
<Date>2003/07/04</Date>
<CustomerId>123</CustomerId>
<CustomerName>Acme Alpha</CustomerName>

<Item>
<ItemId> 987</ItemId>
<ItemName>Coupler</ItemName>
<Quantity>5</Quantity>
</Item>

<Item>
<ItemId>654</ItemId>
<ItemName>Connector</ItemName>
<Quantity unit=“12”>3</Quantity>
</Item>

<Item>
<ItemId>579</ItemId>
<ItemName>Clasp</ItemName>
<Quantity>1</Quantity>
</Item>

</Order>

[fphp]substr/fphp

manual:


echo substr('abcdef', 1);     // bcdef

Open the file, run substr on the contents, write to another file.

But first of all I need to get the file contents to run substr on it. If I pass the file in file_get_contents then it’s only returning TOC^TOC^-1^-1^,^-1^-1%

This function is not considering the xml path


$x = file_get_contents("c:/tmp/test.xml");
echo substr($x, 23);

That works for me? Are you echoing it onto a page and looking at it in a browser or are you writing it to another file?