Permalink
Browse files

only find .png, .jpg, and .jpeg files

  • Loading branch information...
1 parent 0ad2164 commit 7e25560067da437477f9de22047407d16bc350a9 @BaylorRae BaylorRae committed Sep 19, 2012
Showing with 1 addition and 7 deletions.
  1. +1 −7 demo.php
View
@@ -1,12 +1,6 @@
<?php
-$raw_files = glob('*.*');
-$files = array();
-
-foreach( $raw_files as $r ){
- if( preg_match( '/\.(?:png|jpg|jpeg)$/' , $r ) )
- $files[] = $r;
-}
+$files = glob('*.{png,jpg,jpeg}', GLOB_BRACE);
?><!DOCTYPE html>
<html lang="en">

0 comments on commit 7e25560

Please sign in to comment.