Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- $dir_jpg = "../wp-content/uploads/newspaper/jpg/";
- $dir_pdf = "../wp-content/uploads/newspaper/pdf/";
- $images = glob($dir_jpg."*.*");
- $pdfs = glob($dir_pdf."*.*");
- $array = array_combine($images, $pdfs);
- foreach($array as $image => $pdf){
- echo '<ul>';
- echo '<li>';
- echo '<a href="'.$pdf.'" target="_blank"><img src="'.$image.'" height="100" width="100" /></a>';
- echo '</li>';
- echo '</ul>';
- }
Add Comment
Please, Sign In to add comment