$dizi = range(0,50); $count = count($dizi); for ($i = 0; $i<$count; $i++) { $toplam += $dizi[$i]; } echo $toplam;