WifiFormat

Only works on Android devices and is used for wifi configuration. Scanning such a code would, after prompting the user, configure the device's wi-fi accordingly.

Special characters "", ";", "," and ":" should be escaped with a backslash (""). For example, if an SSID was literally "foo;bar\baz" (with double quotes part of the SSID name itself) then it would be encoded like: \"foo\;bar\baz\"

Usage


use Da\QrCode\QrCode;
use Da\QrCode\Format\WifiFormat; 

$format = new WifiFormat(['authentication' => 'WPA', 'ssid' => 'testSSID', 'password' => 'HAKUNAMATATA']);

$qrCode = new QrCode($format);

header('Content-Type: ' . $qrCode->getContentType());

echo $qrCode->writeString();

© 2amigos 2013-2023