Return to Snippet

Revision: 76803
at July 29, 2019 16:05 by martinbrait


Initial Code
<?php

function listfile($sbegin)
{
	// lister fichiers et répertoires commençant par...
	$filelist = array();
	if ($handle = opendir(".")) {
		while ($entry = readdir($handle)) {
			if (strpos($entry, $sbegin) === 0) {
				$filelist[] = $entry;
			}
		}
		closedir($handle);
		print_r ($filelist);
	}
}

listfile('c');
?>

Initial URL


Initial Description
php list files and directories beginning with ....

1 paramètre d'entrée

Initial Title
Lister répertoires et fichiers commençant par ...

Initial Tags
list, files

Initial Language
PHP