html 是
http://abc.com.tw/test.html
test.html 內容如下
<!DOCTYPE html>
<html>
<head>
    <title>test page</title>
</head>
<body>
    <div id="output"></div>
    <script src="jquery-3.1.0.min.js"></script>
    <script type="text/javascript" src="jquery.qrcode.js"></script>
    <script>
        jQuery(setTimeout(function () {
            jQuery('#output').qrcode({
                render: "canvas",
                text: 'test_page',
                width: 200,
                height: 200,
                background: "#ffffff",
                foreground: "#000000",
                src: 'logob.jpg',
                imgWidth: 50,
                imgHeight: 50
            });
            var canvas = $('#output canvas');
            var img = canvas.get(0).toDataURL("image/png");
            document.write('<img src="'+img+'"/>');
        },100))
    </script>
</body>
</html>
輸出是這樣的
想要用引用的方式顯示 那個 html 內的 image 要如何改這 html
引用的方式是 :
<img src="http://abc.com.tw/test.php" alt="test qr-code">
不知道要如何改那個 test.html ....變成 test.php
像這樣

附上上圖 php 內容
<?php
$filename = "palm-fronds-and-sky.png";
$handle = fopen($filename, "rb");
$contents = fread($handle, filesize($filename));
fclose($handle);
header("content-type: image/png");
echo $contents;
?>