함수의 기본문법
12.php
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 | <!DOCTYPE html> <html> <head> <meta charset= "utf-8" > </head> <body> <h1>JavaScript</h1> <script> function a(){ document.write( "Hello JS Function" ); } a(); </script> <h1>php</h1> <?php function a(){ echo "Hello PHP Function " ; } a(); ?> </body> </html> |
함수의 입력과 출력
13.php
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 | <!DOCTYPE html> <html> <head> <meta charset= "utf-8" > </head> <body> <h1>JavaScript</h1> <script> function a(input){ return input+1; } document.write(a(6)); </script> <h1>php</h1> <?php function a( $input ){ return $input +1; } echo a(6); ?> </body> </html> |