Posted by David Gillen on 08/10/07 09:21
Bob Bedford said:
> Hi all,
>
> I've an XML file that takes more than the hosting time limit to be readed by
> a PHP script.
>
> What I'd like to do is split the large XML file (can be more than 30MB) in
> little parts and keep the header for every file.
>
> Here is the idea:
>
><total>
> <head>
> </head>
> <info>
> </info>
> <info>
> </info>
> <info>
> </info>
> ...
></total>
>
> The only change is the amount of "info" available. What I'd like is to split
> the file to create littles ones whit the same <head></head> datas but each
> with less <info> tags (say limited to 3 for every file).
>
> It's there any simple way ? This will only be done if the file is bigger
> than 1MB
>
$xml = simplexml_load_file($xmlFile);
And take it from there. Have a quick read of the simplexml docs. You should
have your solution in very little time.
D.
--
Fermat was right.
Navigation:
[Reply to this message]
|