Advertisement
eyuprog

Simple Read File Extension

Jan 7th, 2014
141
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.36 KB | None | 0 0
  1. <?php
  2. function isJPG($filename){
  3. $ext = substr($filename, -4);
  4. if($ext == '.jpg'){
  5. return true;
  6. }else{
  7. return false;
  8. }
  9. }
  10. $playlist="";
  11. $d = dir('gambar/');
  12. while (false !== ($filename = $d->read())) {
  13. if(isJPG($filename)){
  14. $playlist .= $filename . '|';
  15. // return data
  16. }
  17. }
  18. $d->close();
  19. //paging here
  20. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement