<?php
foreach (file('access.log') AS $value)
{
    if (preg_match("#\.gif#i",$value))
    {
        if($value) $say++;
    }
}
echo $say.' tane gif uzantısı var.';
?>
Kaç tane gif uzantısı olduğunu bu şekilde göstermesi lazım