SYNCERのロゴ
アイキャッチ画像

array_product - 配列の値の積を計算する

array_productは、配列の全ての値の積を計算する関数です。空の配列の場合、1が返ります。

構文

number array_product ( array $array )

パラメータ

$array

対象の配列。

返り値

number

計算結果の数値(integer)、または浮動小数点数(float)。

サンプルコード

<?php
	$array = [ 2, 3, 4 ] ;

	$response = array_product( $array ) ;

デモ

配列の全ての値の積を計算します。

<?php
/*** このコードは編集できます。 ***/

	$array = [ 2, 3, 4 ] ;

	$response = array_product( $array ) ;

	var_dump( $response ) ;
  • Twitterでシェア
  • Facebookでシェア
  • Google+でシェア
  • はてなブックマークでシェア
  • pocketに保存
  • LINEでシェア
更新履歴
2017年6月25日 (日)
コンテンツを公開しました。