<?php
$base64 = 'iVBORw0KGgoAAAANSUhEUgAAAAoAAAAKCAYAAACNMs+';
echo 'plain: ', substr($string = base64_decode($base64), 0, 16), "\n";
echo bin2hex(substr($string, 0, 16)), "\n";
$uri = 'image/png;base64,' . $base64;
$string = file_get_contents('data:' . $uri);
echo 'no slashes: ';
echo substr($string, 0, 16), "\n";
echo bin2hex(substr($string, 0, 16)), "\n";
echo 'with slashes: ';
$string = file_get_contents('data://' . $uri);
echo substr($string, 0, 16), "\n";
echo bin2hex(substr($string, 0, 16)), "\n";
preferences:
28.64 ms | 402 KiB | 5 Q