Posted by mantrid on 10/15/06 13:54
Hello
Found this piece of code using preg_match to check file types during upload
of files.
$allowed_file_types = "(jpg|jpeg|gif|bmp|png)";
preg_match("/\." . $allowed_file_types . "$/i",
$_FILES['uploadedfile']["name"])
I understand the basic preg_match but am confused as to how the string
pattern part is working i.e.
"/\." . $allowed_file_types . "$/i"
I need to understand it better as although it appears to work in other parts
of my site, Im getting an error message on one page
Warning: preg_match() expects parameter 2 to be string, array given in
/home/iddsoftw/public_html/questiondbase/usersquestions.php on line 52
Can anyone give a step by step explanation of what its doing
Thanks
Ian
[Back to original message]
|