Örnek:
function sayilari_topla()
{
$toplam=0;
foreach(func_get_args() as $teksayi)
{
$toplam += $teksayi;
}
return $toplam;
}
echo sayilari_topla(2,5,7,8);
Çıktı:
22
PHP Func_Get_Args Kullanımı |
1 Mesajlar | 964 Okunma |
function sayilari_topla()
{
$toplam=0;
foreach(func_get_args() as $teksayi)
{
$toplam += $teksayi;
}
return $toplam;
}
echo sayilari_topla(2,5,7,8);
22