PHP로 문자를 그림으로 만드는 것
3251 단어 PHP
방문
im.php?str=こんにちは,世界
후 쉼표 구분자로 줄을 바꾸어 이런 이미지를 생성합니다.<?php
if( isset($_GET["str"]) ){
$points = explode(",",$_GET["str"]);
}else{
$str = ["Hello","World"];
}
$im = imagecreatetruecolor(400,600);
imagefilledrectangle($im, 0, 0, 599, 399, 0x101010);
$font = '/font/NotoSansCJKjp-Regular.otf';
$y = 30;
foreach($points as $point){
imagettftext($im, 20, 0, 0, $y, 0xffffff, $font, $point);
$y = $y + 30;
}
header('Content-Type: image/png;');
imagepng($im);
imagedestroy($im);
Reference
이 문제에 관하여(PHP로 문자를 그림으로 만드는 것), 우리는 이곳에서 더 많은 자료를 발견하고 링크를 클릭하여 보았다 https://qiita.com/usop4/items/1b25348ecdbace6b7b7c텍스트를 자유롭게 공유하거나 복사할 수 있습니다.하지만 이 문서의 URL은 참조 URL로 남겨 두십시오.
우수한 개발자 콘텐츠 발견에 전념 (Collection and Share based on the CC Protocol.)