0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

引数の概念がわからないので自分なりに噛み砕いてみた。

0
Posted at

関数を作成するとき「引数」を使うがどうしても私はその概念が理解できない。

なので今回、引数の概念をしっかりと理解するようにしてみた。

引数とは

関数は入力をすると、出力(戻り値という)される。

引数とはその一連の流れの中で「入力」に相当するものである。

例)関数=人   引数=食べ物  戻り値=排泄
 人が食べ物を食べると排泄をする。

一連の流れとしてはこのようなものになる。

実際のコードで引数を見てみる

public function test($people){
   return ($people);
}

echo test('鈴木くん');

とすると  出力結果は 鈴木くんが出るということになる。

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

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?