php基于base64解码图片与加密图片还原实例
程序员文章站
2022-07-11 16:02:54
本文实例讲述了php基于base64解码图片与加密图片还原的实现方法。分享给大家供大家参考。具体实现方法如下:
本例中$data是一段经过base64编码的图片。具体代码...
本文实例讲述了php基于base64解码图片与加密图片还原的实现方法。分享给大家供大家参考。具体实现方法如下:
本例中$data是一段经过base64编码的图片。具体代码如下:
复制代码 代码如下:
<?php
//文件名:base64.php
$data="/9j/4aaqskzjrgabaqaaaqabaad/2wceabalda4mchaodq4seratgcgagbywgdejjr0oojm9pdkzoddasfxoqerxrtc4ug1rv19iz2hnpk1xexbkefxlz2mberisgbuylxoal2ncoejjy2njy2njy2njy2njy2njy2njy2njy2njy2njy2njy2njy2njy2njy2njy2njy2njy//aabeiadiamgmbeqaceqedeqh/xagiaaabbqebaqebaqaaaaaaaaaaaqidbaugbwgjcgsqaaibawmcbamfbqqeaaabfqecawaeequsitfbbhnryqcicrqygzghccncscevuthwjdnicoijchyxgbkajsynkckqndu2nzg5okneruzhselku1rvvldywvpjzgvmz2hpann0dxz3ehl6g4sfhoeiiyqsk5svlpeymzqio6slpqeoqaqys7s1tre4ubrcw8tfxsfiycrs09tv1tfy2drh4upk5ebn6onq8flz9px29/j5+geaawebaqebaqebaqaaaaaaaaecawqfbgcicqoleqacaqiebamebwuebaabancaaqideqqfitegekfrb2fxeyiygqguqpghscejizns8bvictekfiq04sxxfxgzgiynkckqnty3odk6q0rfrkdisuptvfvwv1hzwmnkzwznaglqc3r1dnd4exqcg4sfhoeiiyqsk5svlpeymzqio6slpqeoqaqys7s1tre4ubrcw8tfxsfiycrs09tv1tfy2dri4+tl5ufo6ery8/t19vf4+fr/2gamaweaahedeqa/aj9z1g8i1e5so6mrfbavxia4oaqdvl//aj/j/wdvs0ai2qx/apz+z/8afw0arnq2of8ap7cf9/dqbe2sakol/cf9/dqbc2s6mp8amixp/f00aen27fremkkkqcfyoa4hxjjw7v8a3/6cgbdk0q41qs/z3jxy8z3kjrn0b9kalsnhs/wnmmtudojwgbp/akdqbzrggcfzqba5oa9etv8aj1h/3b/kgdz7xa2ndu/9/wdokanrwss0v+bycj/7nqbktanq0mlyyw7qikwy7xwb170atw+j219oet5aysm6hb3xkgjjk44z06uaqxuk29joen3cysi7n5jibaahxj4z0/mkaodc0wpybx/j1h/3f/lsa858rtjx7z/f/okanvwm37nusoocfyagdal1vuzy2jkvjwrgqylucd2oa2pcg+zgvdtncpaim0j++rzx9on40aj43gezbxu4xmlq6br6lnkh8f6uaca7uwpzbx/j1h/3f/lsa8z8tnjxdej/ag/6cmbbyaveaasq2k3lixaf5qc4zjqpc0aui9afqxv7yttlsgmh2vmeifue/jayaae/tu/xttp/ng2pbgxku989sm9aqgu70ae12v8ax6w/7i/yoa8w8uk//cr3ueyjf2hskygxtk/55v8akaaarj/zzb8jqawrj/zzf8jqbgysn/lm/wd3yaqdfjlp/ln/++tqb7zag/zyep4f/lqa9o0lelfj9xqavlr/880/75fab5uf/pnp++rqaevh/wa80/75fab5uf8azzt/al5fma8qp/nmn/fioacbxsa//9k=";
//文件名:base64.php
$data="/9j/4aaqskzjrgabaqaaaqabaad/2wceabalda4mchaodq4seratgcgagbywgdejjr0oojm9pdkzoddasfxoqerxrtc4ug1rv19iz2hnpk1xexbkefxlz2mberisgbuylxoal2ncoejjy2njy2njy2njy2njy2njy2njy2njy2njy2njy2njy2njy2njy2njy2njy2njy2njy//aabeiadiamgmbeqaceqedeqh/xagiaaabbqebaqebaqaaaaaaaaaaaqidbaugbwgjcgsqaaibawmcbamfbqqeaaabfqecawaeequsitfbbhnryqcicrqygzghccncscevuthwjdnicoijchyxgbkajsynkckqndu2nzg5okneruzhselku1rvvldywvpjzgvmz2hpann0dxz3ehl6g4sfhoeiiyqsk5svlpeymzqio6slpqeoqaqys7s1tre4ubrcw8tfxsfiycrs09tv1tfy2drh4upk5ebn6onq8flz9px29/j5+geaawebaqebaqebaqaaaaaaaaecawqfbgcicqoleqacaqiebamebwuebaabancaaqideqqfitegekfrb2fxeyiygqguqpghscejizns8bvictekfiq04sxxfxgzgiynkckqnty3odk6q0rfrkdisuptvfvwv1hzwmnkzwznaglqc3r1dnd4exqcg4sfhoeiiyqsk5svlpeymzqio6slpqeoqaqys7s1tre4ubrcw8tfxsfiycrs09tv1tfy2dri4+tl5ufo6ery8/t19vf4+fr/2gamaweaahedeqa/aj9z1g8i1e5so6mrfbavxia4oaqdvl//aj/j/wdvs0ai2qx/apz+z/8afw0arnq2of8ap7cf9/dqbe2sakol/cf9/dqbc2s6mp8amixp/f00aen27fremkkkqcfyoa4hxjjw7v8a3/6cgbdk0q41qs/z3jxy8z3kjrn0b9kalsnhs/wnmmtudojwgbp/akdqbzrggcfzqba5oa9etv8aj1h/3b/kgdz7xa2ndu/9/wdokanrwss0v+bycj/7nqbktanq0mlyyw7qikwy7xwb170atw+j219oet5aysm6hb3xkgjjk44z06uaqxuk29joen3cysi7n5jibaahxj4z0/mkaodc0wpybx/j1h/3f/lsa858rtjx7z/f/okanvwm37nusoocfyagdal1vuzy2jkvjwrgqylucd2oa2pcg+zgvdtncpaim0j++rzx9on40aj43gezbxu4xmlq6br6lnkh8f6uaca7uwpzbx/j1h/3f/lsa8z8tnjxdej/ag/6cmbbyaveaasq2k3lixaf5qc4zjqpc0aui9afqxv7yttlsgmh2vmeifue/jayaae/tu/xttp/ng2pbgxku989sm9aqgu70ae12v8ax6w/7i/yoa8w8uk//cr3ueyjf2hskygxtk/55v8akaaarj/zzb8jqawrj/zzf8jqbgysn/lm/wd3yaqdfjlp/ln/++tqb7zag/zyep4f/lqa9o0lelfj9xqavlr/880/75fab5uf/pnp++rqaevh/wa80/75fab5uf8azzt/al5fma8qp/nmn/fioacbxsa//9k=";
$img=base64_decode($data);
echo $img;
?>
引用图片的方法:
复制代码 代码如下:
<img src="base64.php">
运行效果如下图所示:
ps:关于加密技术,本站还提供了如下加密工具供大家参考使用:
图片转换为base64编码在线工具:
md5在线加密工具:http://tools.jb51.net/password/createmd5password
escape加密/解密工具:
在线sha1加密工具:
短链(短网址)在线生成工具:
短链(短网址)在线还原工具:
高强度密码生成器:http://tools.jb51.net/password/createstrongpassword
希望本文所述对大家的php程序设计有所帮助。