TRI0N Posted February 25, 2007 Share Posted February 25, 2007 Never had to use a wildcard before except for Database ones but here is the code. I want it to filter out a few things and want to create a wildcard for Adobe Illistrator files *.ai in this directory but can view everthing else in the dir which are all Adobe Acrobat files *.pdf and I already have it ignoring the index.php so that it doesn't list in the directory listing. Right now it shows all *.ai and *.pdf files. What do I use to filter out *.ai files? if($file != "." && $file != "index.php" && $file != "..") { Thanks to anyone that can tip me on this.. I tried % like you would for MySQL, * like almost anything uses, and _ like 1 character wildcard of MySQL and all of them don't do the gig. Link to comment https://forums.phpfreaks.com/topic/40042-solved-wildcard-for-file-name-directory-listing/ Share on other sites More sharing options...
Orio Posted February 25, 2007 Share Posted February 25, 2007 Use strrchr(): if($file != "." && $file != "index.php" && $file != ".." && strrchr($file, ".") != ".ai") { Orio. Link to comment https://forums.phpfreaks.com/topic/40042-solved-wildcard-for-file-name-directory-listing/#findComment-193649 Share on other sites More sharing options...
TRI0N Posted February 25, 2007 Author Share Posted February 25, 2007 Very Nice.. Thanks.. Never had to play with anything like that before.. hehe Link to comment https://forums.phpfreaks.com/topic/40042-solved-wildcard-for-file-name-directory-listing/#findComment-193657 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.