기본적으로 Google의 QR 코드 API를 사용하여 바이트 배열에서 QR 코드를 만들려고합니다. 나는 'chl'변수 (QR 코드 용 데이터)에 대한 바이트 배열을 Google 웹 백엔드를 통과 시키려고 시도했지만 결코 마음에 들지 않습니다. 필자는 코드의 기초로 Google의 PHP 예제를 사용했지만 누군가가 Google의 API를 사용하여 바이트 배열을 QR 코드로 변환하는 유일한 방법을 알고 있다면 그게 유일한 목표입니다.QR 코드로 작은 파일
<?php
// Create some random text-encoded data for a QR code.
//header('content-type: image/png');
$url = 'https://chart.googleapis.com/chart?chid=' . md5(uniqid(rand(), true));
$chd = file($_FILES["file"]["tmp_name"]);
// Add image type, image size, and data to params.
$qrcode = array(
'cht' => 'qr',
'chs' => '300x300',
'choe' => 'ISO-8859-1',
'chl' => $chd);
// Send the request, and print out the returned bytes.
$context = stream_context_create(
array('http' => array(
'method' => 'POST',
'content' => http_build_query($qrcode))));
fpassthru(fopen($url, 'r', false, $context));
?>
업로드 된 파일을 처리하고 바이트 배열을 통해 Google의 API로 보내는 PHP가 있습니다.
시도한 코드를 알려주십시오. – richsage
데이터를 16 진수로 변환 해 볼 수 있습니다. – Blender
업로드 된 파일에서 바이트 배열을 보내는 데 PHP가 일부 추가되었습니다. – VashGH