Reply to preg_match explanation

Your name:

Reply:


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]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация