Yosko's snippets

Snippets gathered around the web



CSS 2 CSharp 1 HTML 2 Javascript 2 PHP 12 XML 1 color 2 image 1 security 2

.

HTML

Base64 image in HTML/PHP

<?php

// GD method
ob_start ();
$img = imagecreatefrompng('source.png');
imagepng($img);
$img_data = ob_get_contents ();
ob_end_clean ();

// file method
$img_data = file_gets_contents('source.png');

// encode data in base64
$img_data_base64 = base64_encode ($img_data);

?>

<img src="data:image/png;base64,<?php echo $img_data_base64; ?>" alt="">

HTML PHP

<iframe width="100%" height="506" src="http://snip.yosko.net/index.php?embed=564065d96ea1d" type="text/html"></iframe>

Text only - Permalink - Snippet public post date 09/11/2015

HTML5 Page de base

<!doctype html>
<html lang="fr-FR">
    <head>
        <meta charset="UTF-8">
        <title>Page HTML5</title>
        <style></style>
        <script></script>
        <link rel="stylesheet" href="style.css">
        <link href="icon.png" rel="icon" type="image/x-icon" />
        <script type="text/javascript" src="script.js"></script></head>
    </head>
    <body>

    </body>
</html>

HTML

<iframe width="100%" height="452" src="http://snip.yosko.net/index.php?embed=5200a650e75db" type="text/html"></iframe>

Text only - Permalink - Snippet public post date 11/06/2021

This page's Feed


Yosko's snippets 1.84 by Bronco - generated in 0.004 s