1
$imgPath = """BASE64 ENCODED STRING HERE""";

header('Content-Type: image/png');
$img = str_replace('data:image/png;base64,', '', $imgPath);
$img = str_replace(' ', '+', $img);
$data = base64_decode($img);
$file = "test.png";
$success = file_put_contents($file, $data);

$html = '<img src="'.$file.'" />';
exit;

ここでtest.pngはff/chrome fineで作成されています...しかし、IEは壊れた画像を吸い込んで生成します。

4

0 に答える 0