if(move_uploaded_file($_FILES[$thumbnail_fieldname]['tmp_name'], $thumbnail_filename) &&
//move desktop files
move_uploaded_file($_FILES[$desktop_fieldname_1280x800]['tmp_name'], $desktop_filename_1280x800) &&
move_uploaded_file($_FILES[$desktop_fieldname_1366x768]['tmp_name'], $desktop_filename_1366x768) &&
move_uploaded_file($_FILES[$desktop_fieldname_1920x1080]['tmp_name'], $desktop_filename_1920x1080)){
echo "<p>We can move all files.</p>";}
In my code above the text is not printed when one of the conditions fail, and that is because of && which means all needs to be true, what I want to achieve here is when any of the file is selected to upload it should go through条件并打印文本,如果没有选择任何一个或两个文件,它可以跳过并仍然打印文本,因为一个文件存在,如果没有选择文件,则条件应该为假。它不能用 || 完成 因为如果一个是真的,一切都是真的,那么可以使用什么组合来做到这一点?
例如缩略图文件已移动 = ture
桌面文件 1280x800 已移动 = 真的
桌面文件 1366x768未移动= false //从这里它应该测试下一个条件
桌面文件 1920x1080 已移动 = true
//并且应该打印输出。