<?php
ini_set('display_errors', 1);
ini_set('display_startup_errors', 1);
error_reporting(E_ALL);
include 'helpers.php';
$foldername = uniqid();
$destination = "vierkant/$foldername";
$locatie = "circles/$foldername";
createDirectory($locatie);
createDirectory($destination);
$upload_files = [];
for ($i = 0; $i < count($_FILES['file']['name']); $i++) {
move_uploaded_file(
$_FILES['file']['tmp_name'][$i],
$destination . '/' . $_FILES['file']['name'][$i]
);
$target_name = $_FILES['file']['name'][$i];
// Remove the extension and replace it with .png.
imagepng(imagecreatefromstring(file_get_contents($_FILES["file"]["tmp_name"] )), "output.png");
// One method for this is to use the "explode" function with a dot as a delimiter.
// variable we are going to split
print_r (explode(".",$target_name));
// Then replace the last part with png and then stick the string back together with "implode"
$upload_files[] = [
'square' => $destination . '/' . $_FILES['file']['name'][$i],
'circle' => $locatie . '/' . $_FILES['file']['name'][$i],
];
}
foreach ($upload_files as $loopdata) {
print_r($loopdata['circle']);
toCircle($loopdata['square'],$loopdata['circle'],'450');
}
I have to do this but i get this error: https://ibb.co/mFzxqXL
can anyone help me?
// Remove the extension and replace it with .png.
// One method for this is to use the "explode" function with a dot as a delimiter.
// variable we are going to split:
// Then replace the last part with png and then stick the string back together with "implode"