PHP Classes

File: classes/Find/

Recommend this page to a friend!
  Classes of Ravi Kumar  >  SPL Find Images  >  classes/Find/  >  Download  
File: classes/Find/
Role: Auxiliary data
Content type: text/markdown
Description: Auxiliary data
Class: SPL Find Images
Get images for a gallery using SPL find iterators
Author: By
Last change: first commit
Date: 8 months ago
Size: 842 bytes


Class file image Download

SPL Find

This package provides specialized Iterator classes for finding files and directories.

	include_once 'Find.php';

	$path 		=	realpath( 'YOUR_PATH' );

	$find = new Find;
	$files = $find->in( $path );

	foreach( $files as $key => $file) {
		echo '<pre> ' , $key . ' <br> ' , print_r($file, 1), '</pre>';


It uses template and fluent design pattern.

  1. extension
  2. sort
  3. limit


This is used to filter the files on the basis of extensions of the file.

	$files = $find->extension(['jpg'])->in( $path );	


This is used to sort the files. <br> const SORT_BY_NAME = 1 <br> const SORT_BY_NAT_NAME = 2

	$files = $find->sort( 2 )->in( $path );	


This is used to limit the output files.

	$files = $find->limit( $offset, $limit )->in( $path );	
For more information send a message to info at phpclasses dot org.