php base64互转pdf 将base64解析成pdf

/*
 * 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);//写
}

 

 
  

转载于:https://my.oschina.net/wxphp/blog/655866

转载于:https://www.cnblogs.com/mg007/p/10140035.html

              https://blog.csdn.net/chubi1163/article/details/100612787 

你可能感兴趣的:(php base64互转pdf 将base64解析成pdf)