Skip to content

Instantly share code, notes, and snippets.

@lahmacun
Last active January 10, 2018 23:20
Show Gist options
  • Save lahmacun/44c8dcf6a84aeb52d6823208f1bd293f to your computer and use it in GitHub Desktop.
Save lahmacun/44c8dcf6a84aeb52d6823208f1bd293f to your computer and use it in GitHub Desktop.
<?php
function topla() {
$toplam = 0;
$argumanSayisi = func_num_args();
for ($i = 0; $i < $argumanSayisi; $i ++) {
$toplam += func_get_arg($i);
}
return $toplam;
}
function carpma() {
$carpim = 1;
$argumanSayisi = func_num_args();
for ($i = 0; $i < $argumanSayisi; $i ++) {
$carpim *= func_get_arg($i);
}
return $carpim;
}
// Ornek Kullanim
// echo carpma(2, 3, 4); // 24 dondurur
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment