Jump to content

xml file compression with .php


Murciano

Recommended Posts

I need to compress xml files with something like this

$content = file_get_contents("includes/datafeed.xml");
$compressed = base64_encode(gzcompress($content));
?>
<textarea>
<?php
echo $compressed;

?>

</textarea>

as you can see im echo'ing the output to see if it is working, Hmmmmmmm it does to an extent,

 

the thing is that to be sure its working  i am uncompressing the original unedited datafeed.xml.gz files with

$content = file_get_contents("datafeed.xml.gz");
        $coded = gzuncompress(substr(base64_decode($content),3));

 

and then recompressing with the code that is inside the first block, echoing the code to check and they are very different, am i missing something?.. mime types etc,

 

 

Link to comment
https://forums.phpfreaks.com/topic/200574-xml-file-compression-with-php/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.