わかりましたので、これを機能させようとしてきましたが、エラーは表示されませんが、構文チェッカーは14行目にエラーがあると断言しています。
<?php
// Define a destination
$targetFolder = '***********'; // Relative to the root
if (!empty($_FILES)) {
$tempFile = $_FILES['Filedata']['tmp_name'];
$tempFileExploded = explode($tempFile, ".");
//PROBLEM LINE
$tempFile = $tempFileExploded[0] . date('U') . $tempFileExploded[1];
$targetPath = $_SERVER['DOCUMENT_ROOT'] . $targetFolder;
$targetFile = rtrim($targetPath,'/') . '/' . $_FILES['Filedata']['name'];
//mkdir(str_replace('//','/',$targetPath), 0777, true);
// Validate the file type
$fileTypes = array('jpg','jpeg','gif','png'); // File extensions
$fileParts = pathinfo($_FILES['Filedata']['name']);
if (in_array($fileParts['extension'],$fileTypes)) {
move_uploaded_file($tempFile,$targetFile);
echo '1';
} else {
echo 'Invalid file type.';
}
}
//$targerfile is the file name
?>
エラーは次のとおりです。
解析エラー: 構文エラー、14 行目の CODE に予期しない T_STRING CODE 解析エラー