接收前端发送的文本,使用php内置函数实现文本转换图片<?php header('Content-Type: text/html; charset=utf-8'); $content = file_get_contents("php://input"); $content = json_decode($content,true); $type = $content['type']; $errcode = 0; $errtext = ""; $myJson = array(); $greetingpath = 'static/greeting/';//合成图片目录 $jsonfile = 'config.json';//语言合成config文件 $fontttf = "./static/dist/fonts/xiekai.ttf"; //文本字体

后端 2018-08-14