我正在创建一个页面,供用户上传文件。如果文件类型是其他jpg,gif和pdf,我希望使用if语句创建$ error变量。
这是我的代码:
$file_type = $_FILES['foreign_character_upload']['type']; //returns the mimetypeif(/*$file_type is anything other than jpg, gif, or pdf*/) { $error_message = 'Only jpg, gif, and pdf files are allowed.'; $error = 'yes';}
我在构造if语句时遇到困难。我怎么说呢
繁华开满天机
桃花长相依