file_put_contents 和php://input 实现存储数据进图片中
<?php
/**
*Recieve p_w_picpath data
**/
error_reporting(E_ALL);
function get_contents()
{
$xmlstr = file_get_contents("php://input");
$filename = time() . '.png';
if (file_put_contents($filename, $xmlstr)) {//将数据存储进图片格式中
echo 'success';
} else {
echo 'failed';
}
}
//get_contents();
var_dump(file_get_contents('1565341389.png')); //读取图片,获取图片中的数据
die();

赞赏码
非学,无以致疑;非问,无以广识

浙公网安备 33010602011771号