Warning: file_get_contents(/data/phpspider/zhask/data//catemap/0/laravel/10.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Php Laravel 5.2-Intervation图像,保存base64输入图像_Php_Laravel_Base64 - Fatal编程技术网

Php Laravel 5.2-Intervation图像,保存base64输入图像

Php Laravel 5.2-Intervation图像,保存base64输入图像,php,laravel,base64,Php,Laravel,Base64,我将图像base64传递给我的控制器输入,我使用intervation图像调整大小,使用画布,保存图像。但我在解码image base64时遇到一些问题: PostController.php第163行中的ErrorException:base64_decode()应为 参数1为字符串,数组给定 退回这个: 使用 foreach($image_array as $key => $image) { $file = base64_decode($image); 错误发生的原因是在fo

我将图像base64传递给我的控制器输入,我使用intervation图像调整大小,使用画布,保存图像。但我在解码image base64时遇到一些问题:

PostController.php第163行中的ErrorException:base64_decode()应为 参数1为字符串,数组给定

退回这个: 使用

foreach($image_array as $key => $image) {
    $file = base64_decode($image);
错误发生的原因是在
for
循环中您使用的是数值,但
$image\u数组
具有非数值索引。第一个索引不是
0
,而是
dsdas.PNG

$image_array = $request->input('image');
return dd($image_array[1]);
foreach($image_array as $key => $image) {
    $file = base64_decode($image);