Listing 16.6. Plik index.php z ćwiczenia 16.8
<?php
function image_encode($AFileName)
{
    return
        'data: ' .
        'image/jpeg' .
        ';base64, ' .
        base64_encode(file_get_contents($AFileName));
}
?>
<!DOCTYPE html>
<html lang="pl">
  <head>
    <title>Ćwiczenie 16.8</title>
    <meta charset="UTF-8" />
    <style>
    body {
        background: #fdf7d0
    }
    img {
        border: 1px solid black;
    }
    div {
        width: 400px;
        margin: 50px auto;
        background: #fefce9;
        border: 5px solid #74500c;
        padding: 40px;
        text-align: center;
    }
    </style>
  </head>
<body>

<div>
    <h1>Pieniądze</h1>
    <img src="<?php echo image_encode('money.jpg') ?>" alt="" />
</div>

</body>
</html>