Skip to content

Instantly share code, notes, and snippets.

@hemantajax
Created September 1, 2012 14:27
Show Gist options
  • Save hemantajax/3574740 to your computer and use it in GitHub Desktop.
Save hemantajax/3574740 to your computer and use it in GitHub Desktop.
using glob to manipulate file
<?php
$images=glob("images/*.{png,jpg,jpeg}",GLOB_BRACE);
foreach ($images as $img) {
$pathinfo=pathinfo($img);
$thumb=$pathinfo['filename']."-thumb.".$pathinfo['extension']."<br />";
echo $thumb;
}
?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment