Regex Extension comparer


/ Published in: PHP
Save to your folder(s)

I whipped this up after finding that my worst fears were true, pathinfo is slow. Top that with in_array and you've got your self some heavy code. Nothing like regex to speed things up.

This little code checks the extension of a path to see if it is a desired extension.

EDIT: the regex engine kills any speed benefits...

Report this snippet


Comments

RSS Icon Subscribe to comments

You need to login to post a comment.