【PHP】图片转换为base64,经过post传输后‘+’会变成 ‘空格’

图片转换为base64,经过post传输后‘+’会变成 ‘空格’, 
需要用PHP 处理一下 

$str= $_POST['img_data'];
$str= str_replace(' ','+',$str);
file_put_contents('./test.png',base64_decode($str));
原文地址:https://www.cnblogs.com/richerdyoung/p/11377396.html