LoginSignup
0
0

More than 3 years have passed since last update.

php(関数と引数)

Posted at

関数と引数について理解したことを備忘録として記録します。

●ユーザー定義関数の型
function 関数名(引数1、引数2、…){
//処理内容
return値;
}

例)
<?php
function heikin($num1, $num2){
$result = ($num1 + $num2) / 2;
print $num1.'と'.$num2.'の平均は'.$result.'です';
}

heikin(10, 8);
heikin(3, 23);

・出力結果
PHPのテストです。

10と8の平均は9です
3と23の平均は13です

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0