diff --git a/php/qrcode.php b/php/qrcode.php
index 234a38b..1e75416 100644
--- a/php/qrcode.php
+++ b/php/qrcode.php
@@ -551,6 +551,68 @@ function printHTML($size = "2px") {
print("");
}
+
+ public function toHtml($size = "2px", $color = '#000', $background = null) {
+
+ $class = uniqid('qr');
+ $html = "
";
+
+ $bg = $background === null ? '' : ' style="background-color:' . $background . '"';
+
+ for ($r = 0, $moduleCount = $this->getModuleCount(); $r < $moduleCount; $r++) {
+
+ $html .= '';
+
+ for ($c = 0; $c < $moduleCount; $c++) {
+ $html .= '| isDark($r, $c) ? " style='background-color:$color'" : $bg) . '/>';
+ }
+
+ $html .= ' |
';
+ }
+
+ return $html . '
';
+ }
+
+ public function toSvg($scale = 5, $color = '#000', $background = null, $opacity = 1) {
+
+ $class = uniqid('qr');
+ $moduleCount = $this->getModuleCount();
+ $length = $moduleCount * $scale;
+
+ $bg = $background === null ? '' : ' style="background-color:' . $background . '"';
+
+ $svg = '';
+ }
}
//---------------------------------------------------------------