It's a simple question, but no matter where I look, I can't seem to figure out how it works. I believe it's taking the first character off the beginning of $variable, but how does count($variable)-1
do this?
$variable[count($variable)-1]
Full code:
$fileType = explode('.',$_FILES['Filedata']['name']);
$fileName = str_ireplace('.jpg', '', $_FILES['Filedata']['name']);
$targetFile = str_replace('//','/',$targetPath) . $fileName .'.'.$fileType[count($fileType)-1];