코드:
결과보기 »
<!DOCTYPE html> <html lang="ko"> <head> <meta charset="UTF-8"> <title>PHP Function</title> </head> <body> <?php function sum($value1, $value2 = 0, $value3 = 0) { return $value1 + $value2 + $value3; } echo sum(1, 2, 3)."<br>"; echo sum(1, 2)."<br>"; echo sum(1); //echo sum(); // 오류가 발생함. ?> </body> </html>