So i'm printing an array that i'm getting but i can't figure out how to access the stuff, im an complete noob by the way.
Thing i want to unpack:
code:
<?php
$file = $_FILES['files'];
$fileName = $_FILES['files']['name'];
$fileTmpName = $_FILES['files']['tmp_name'];
$fileSize = $_FILES['files']['size'];
$fileError = $_FILES['files']['error'];
$fileType = $_FILES['files']['type'];
print_r(in_array("screenshot.jpg", $fileName)."woooo");
print_r($file);
$fileExt = explode(".", $fileName);
$fileActualExt = strtolower(end($fileExt));
$allowed = array('jpg', "jpeg", "png", "pdf");
if (in_array($fileActualExt, $allowed)){
if ($fileError === 0) {
if($fileSize < 1000000) {
$fileNameNew = uniqid('', true).".".$fileActualExt;
$fileDestination = 'uploads/'.$fileNameNew;
move_uploaded_file($fileTmpName, $fileDestination);
} else {
echo 'You can not have a file bigger than 1 GigaByte!';
}
}else {
print_r($fileError);
echo 'There was an error uploading your file!';
}
}else {
echo "You cannot upload files of this type!";
}
but i do not know how to print the name that first name that im getting.
