Domanda

I have to decode a large string base64 encoded:

<?php
        $str ='base64code';
    echo base64_decode($str);
?>

The link contains the base64 encoded string: http://www.interwebmedia.nl/dataxi/base64.txt

Online decoders give the right result but this php function doesn't. Is there a solution?

È stato utile?

Soluzione

base64_decode outputs exactly what was encoded before. It does not adapt any contained values.

You are writing everything out in HTML context. And there any <tags> will not be shown in the browser window. Use show source. Or htmlspecialchars.

Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a StackOverflow
scroll top