Skip to content

Instantly share code, notes, and snippets.

@cirpo
Created July 7, 2010 21:26
Show Gist options
  • Save cirpo/467311 to your computer and use it in GitHub Desktop.
Save cirpo/467311 to your computer and use it in GitHub Desktop.
<?php
$file = 'cirpo.jpeg';
$regex = "/\.(?:|jpe?g)\$/i";
preg_match_all($regex, $file, $out, PREG_SET_ORDER);
var_dump($out);
?>
output:
array(1) {
[0]=>
array(1) {
[0]=>
string(5) ".jpeg"
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment