The database I am using is Postgresql and I downloading a webpage and storing in a BLOB. Like this:
<?php
$html = file_get_contents('http://www.example.com');
$encoded_html = base64_encode($html);
//Store encoded data in blob in database
?>
That part works fine. But when I try to decode it and display it, it comes out garabled.
<?php echo base64_decode($encoded_html); ?>
Do I have to add extra parameters when encoding and decoding the data?