php中base64转pdf的方法是什么-PHP问题

资源魔 35 0

php中base64转pdf的办法:起首找到转化的pdf文件;接着应用函数“file_get_contents”来读取数据;而后应用函数“base64_decode”转化;最初应用函数“file_put_contents”写入数据便可。

/*
 * base64转pdf
 */function base642pdf($formTxt,$toPdf){
	$file = file_get_contents($formTxt);//读
    $data = base64_decode($file);//转换
	file_put_contents($toPdf, $data);//写}/*
 * pdf转base64
 */function pdf2base64($formPdf,$toTxt){
	$file = file_get_contents($formPdf);//读
    $data = base64_encode($file);//转换
	file_put_contents($toTxt, $data);//写}

保举教程: 《php教程》

以上就是php中base64转pdf的办法是甚么的具体内容,更多请存眷资源魔其它相干文章!

标签: php php教程 php故障解决 php使用问题

抱歉,评论功能暂时关闭!