All pastes #926239 Raw Edit

Someone

public text v1 · immutable
·published 2008-03-03 16:55 UTC
rendered paste body
function recupextention ($filename)
{
	return substr(strrchr($filename, '.'), 1);
}

function listeRep($rep)
{
	if (is_dir($rep))
	{
		if ($rh = opendir($rep))
		{
			$i = 0;
			while (($file = readdir($rh)) !== false)
			{
				if ($file != '.' && $file != '..')
				{
					if (!is_dir($rep.$file) && (recupextention($file)=="jpg" || recupextention($file)=="gif" || recupextention($file)=="png" || recupextention($file)=="jpeg" || recupextention($file)=="JPG" || recupextention($file)=="GIF" || recupextention($file)=="PNG" || recupextention($file)=="JPEG"))
					{
						$i++;
					}
				}
			}
		}
	}
        return $i;
}