PHP 8.5.0 Alpha 2 available for testing

Voting

: min(three, five)?
(Example: nine)

The Note You're Voting On

Naser Mirzaei
11 years ago
<?php
$image
= 'example.png';

// Read image path, convert to base64 encoding
$imageData = base64_encode(file_get_contents($image));

// Format the image SRC: data:{mime};base64,{data};
$src = 'data: '.mime_content_type($image).';base64,'.$imageData;

// Echo out a sample image
echo "<img src=\"$src\" alt=\"\" />";
?>

<< Back to user notes page

To Top