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