Actions

Translations

ExpressionScript - Presentation/105/ja: Difference between revisions

From LimeSurvey Manual

(Created page with "{| class="wikitable" !関数!!意味!!構文 |- |[http://www.php.net/manual/en/function.abs.php abs]||絶対値||number abs(数値) |- |[http://www.php.net/manual/en/function....")
 
No edit summary
 
Line 99: Line 99:
|[http://www.php.net/manual/en/function.quotemeta.php quotemeta]||メタ文字をクォートする||string quotemeta(文字列)
|[http://www.php.net/manual/en/function.quotemeta.php quotemeta]||メタ文字をクォートする||string quotemeta(文字列)
|-
|-
|[http://www.php.net/manual/en/function.rand.php rand]||乱数を生成する([[ExpressionScript sample surveys/ja#Randomly Ask One Question Per Group|例]])||int rand()またはint rand(最小値, 最大値)
|[http://www.php.net/manual/en/function.rand.php rand]||乱数を生成する([[ExpressionScript sample surveys/ja#.E3.82.B0.E3.83.AB.E3.83.BC.E3.83.97.E3.81.94.E3.81.A8.E3.81.AB.E3.83.A9.E3.83.B3.E3.83.80.E3.83.A0.E3.81.AB.E8.B3.AA.E5.95.8F.E3.81.99.E3.82.8B|例]])||int rand()またはint rand(最小値, 最大値)
|-
|-
|regexMatch||文字列を[[Using regular expressions/ja|正規表現]]で比較する||bool regexMatch(パターン,文字列)
|regexMatch||文字列を[[Using regular expressions/ja|正規表現]]で比較する||bool regexMatch(パターン,文字列)

Latest revision as of 02:55, 26 April 2020

Message definition (ExpressionScript - Presentation)
{| class="wikitable"
!Function!!Meaning!!Syntax
|-
|[http://www.php.net/manual/en/function.abs.php abs]||Absolute value||number abs(number)
|-
|[http://www.php.net/manual/en/function.acos.php acos]||Arc cosine||number acos(number)
|-
|[http://www.php.net/manual/en/function.addslashes.php addslashes]||Quote string with slashes||string addslashes(string)
|-
|[http://www.php.net/manual/en/function.asin.php asin]||Arc sine||number asin(number)
|-
|[http://www.php.net/manual/en/function.atan.php atan]||Arc tangent||number atan(number)
|-
|[http://www.php.net/manual/en/function.atan2.php atan2]||Arc tangent of two variables||number atan2(number, number)
|-
|[http://www.php.net/manual/en/function.ceil.php ceil]||Round fractions up||number ceil(number)
|-
|[http://www.php.net/manual/en/function.checkdate.php checkdate]||Returns true(1) if it is a valid date in gregorian calendar||bool checkdate(month,day,year)
|-
|convert_value||Convert a numerical value using a inputTable and outputTable of numerical values||number convert_value(fValue, iStrict, sTranslateFromList, sTranslateToList)
|-
|[http://www.php.net/manual/en/function.cos.php cos]||Cosine||number cos(number)
|-
|count||count the number of answered (non-blank) questions in the list||number count(arg1, arg12, ..., argN)
|-
|countif||Count the number of answered questions in the list equal to the first argument||number countif(matches, arg1, arg2, ... argN)
|-
|countifop||Count the number of answered questions in the list which pass the criteria (arg op value)||number countifop(op, value, arg1, arg2, ... argN)
|-
|[http://www.php.net/manual/en/function.date.php date]||Format a local date/time||string date(format <nowiki>[</nowiki>, timestamp=time()])
|-
|[http://www.php.net/manual/en/function.exp.php exp]||Calculates the exponent of e||number exp(number)
|-
|fixnum||Display numbers with comma as radix separator, if needed||string fixnum(number)
|-
|[http://www.php.net/manual/en/function.floor.php floor]||Round fractions down||number floor(number)
|-
|[http://www.php.net/manual/en/function.gmdate.php gmdate]||Format a GMT date/time||string gmdate(format <nowiki>[</nowiki>, timestamp=time()])
|-
|[http://www.php.net/manual/en/function.html-entity-decode.php html_entity_decode]||Convert all HTML entities to their applicable characters (always uses ENT_QUOTES and UTF-8)||string html_entity_decode(string)
|-
|[http://www.php.net/manual/en/function.htmlentities.php htmlentities]||Convert all applicable characters to HTML entities (always uses ENT_QUOTES and UTF-8)||string htmlentities(string)
|-
|[http://www.php.net/manual/en/function.htmlspecialchars.php expr_mgr_htmlspecialchars]||Convert special characters to HTML entities (always uses ENT_QUOTES and UTF-8)||string htmlspecialchars(string)
|-
|[http://www.php.net/manual/en/function.htmlspecialchars-decode.php expr_mgr_htmlspecialchars_decode]||Convert special HTML entities back to characters (always uses ENT_QUOTES and UTF-8)||string htmlspecialchars_decode(string)
|-
|[http://www.php.net/manual/en/function.idate.php idate]||Format a local time/date as integer||string idate(string <nowiki>[</nowiki>, timestamp=time()])
|-
|if||Excel-style if(test,result_if_true,result_if_false)||if(test,result_if_true,result_if_false)
|-
|[http://www.php.net/manual/en/function.implode.php implode]||Join array elements with a string||string implode(glue,arg1,arg2,...,argN)
|-
|[http://www.php.net/manual/en/function.intval.php intval]||Get the integer value of a variable||int intval(number <nowiki>[</nowiki>, base=10])
|-
|[http://www.php.net/manual/en/function.empty.php is_empty]||Determine whether a variable is considered to be empty||bool is_empty(var)
|-
|[http://www.php.net/manual/en/function.is-float.php is_float]||Finds whether the type of a variable is float||bool is_float(var)
|-
|[http://www.php.net/manual/en/function.is-int.php is_int]||Find whether the type of a variable is integer||bool is_int(var)
|-
|[http://www.php.net/manual/en/function.is-nan.php is_nan]||Finds whether a value is not a number||bool is_nan(var)
|-
|[http://www.php.net/manual/en/function.is-null.php is_null]||Finds whether a variable is NULL||bool is_null(var)
|-
|[http://www.php.net/manual/en/function.is-numeric.php is_numeric]||Finds whether a variable is a number or a numeric string||bool is_numeric(var)
|-
|[http://www.php.net/manual/en/function.is-string.php is_string]||Find whether the type of a variable is string||bool is_string(var)
|-
|join{{NewIn|2.0|b=130129}}||Join elements as a new string||join(arg1, arg2, ... argN)
|-
|list||Return comma-separated list of non-blank values||string list(arg1, arg2, ... argN)
|-
|listifop{{NewIn|3.16.1}}||Return a 'glue'-separated list of the specified question property (retProp) from questions in the list which pass the criteria (cmpProp op value)||string listifop(cmpProp, op, value, retProp, glue, sgqa1, sgqa2, ... sgqaN)
|-|[http://www.php.net/manual/en/function.log.php log]|| The logarithm of number to base, if given, or the natural logarithm. ||number log(number,base=e)
|-
|[http://www.php.net/manual/en/function.ltrim.php ltrim]||Strip whitespace (or other characters) from the beginning of a string||string ltrim(string <nowiki>[</nowiki>, charlist])
|-
|[http://www.php.net/manual/en/function.max.php max]||Find highest value||number max(arg1, arg2, ... argN)
|-
|[http://www.php.net/manual/en/function.min.php min]||Find lowest value||number min(arg1, arg2, ... argN)
|-
|[http://www.php.net/manual/en/function.mktime.php mktime]||Get UNIX timestamp for a date (each of the 6 arguments are optional)||number mktime([hour [, minute [, second [, month [, day [, year ]]]]]])
|-
|modulo-function||The modulo function is '''not supported''' yet. You can use the floor() function instead||floor(x/y)==(x/y)
|-
|[http://www.php.net/manual/en/function.nl2br.php nl2br]||Inserts HTML line breaks before all newlines in a string||string nl2br(string)
|-
|[http://www.php.net/manual/en/function.number-format.php number_format]||Format a number with grouped thousands||string number_format(number)
|-
|pi||Get value of pi||number pi()
|-
|[http://www.php.net/manual/en/function.pow.php pow]||Exponential expression||number pow(base, exp)
|-
|[http://www.php.net/manual/en/function.quoted-printable-decode.php quoted_printable_decode]||Convert a quoted-printable string to an 8 bit string||string quoted_printable_decode(string)
|-
|[http://www.php.net/manual/en/function.quoted-printable-encode.php quoted_printable_encode]||Convert a 8 bit string to a quoted-printable string||string quoted_printable_encode(string)
|-
|[http://www.php.net/manual/en/function.quotemeta.php quotemeta]||Quote meta characters||string quotemeta(string)
|-
|[http://www.php.net/manual/en/function.rand.php rand]||Generate a random integer, see [[ExpressionScript sample surveys#Randomly Ask One Question Per Group|this example]]||int rand() OR int rand(min, max)
|-
|regexMatch||compare a string to a [[Using regular expressions|regular expression]]||bool regexMatch(pattern,input)
|-
|[http://www.php.net/manual/en/function.round.php round]||Rounds a number to an optional precision||number round(val <nowiki>[</nowiki>, precision])
|-
|[http://www.php.net/manual/en/function.rtrim.php rtrim]||Strip whitespace (or other characters) from the end of a string||string rtrim(string <nowiki>[</nowiki>, charlist])
|-
|[http://www.php.net/manual/en/function.sin.php sin]||Sine||number sin(arg)
|-
|[http://www.php.net/manual/en/function.sprintf.php sprintf]||Return a formatted string||string sprintf(format, arg1, arg2, ... argN)
|-
|[http://www.php.net/manual/en/function.sqrt.php sqrt]||Square root||number sqrt(arg)
|-
|stddev||Calculate the Sample Standard Deviation for the list of numbers||number stddev(arg1, arg2, ... argN)
|-
|[http://www.php.net/manual/en/function.str-pad.php str_pad]||Pad a string to a certain length with another string||string str_pad(input, pad_length <nowiki>[</nowiki>, pad_string])
|-
|[http://www.php.net/manual/en/function.str-repeat.php str_repeat]||Repeat a string||string str_repeat(input, multiplier)
|-
|[http://www.php.net/manual/en/function.str-replace.php str_replace]||Replace all occurrences of the search string with the replacement string||string str_replace(search, replace, subject)
|-
|[http://www.php.net/manual/en/function.strcasecmp.php strcasecmp]||Binary safe case-insensitive string comparison||int strcasecmp(str1, str2)
|-
|[http://www.php.net/manual/en/function.strcmp.php strcmp]||Binary safe string comparison||int strcmp(str1, str2)
|-
|[http://www.php.net/manual/en/function.strip-tags.php strip_tags]||Strip HTML and PHP tags from a string||string strip_tags(str, allowable_tags)
|-
|[http://www.php.net/manual/en/function.stripos.php stripos]||Find position of first occurrence of a case-insensitive unicode string (starting by 0, return false if not found)|||int stripos(haystack, needle <nowiki>[</nowiki>, offset=0])
|-
|[http://www.php.net/manual/en/function.stripslashes.php stripslashes]||Un-quotes a quoted string||string stripslashes(string)
|-
|[http://www.php.net/manual/en/function.stristr.php stristr]||Case-insensitive strstr||string stristr(haystack, needle <nowiki>[</nowiki>, before_needle=false])
|-
|[http://www.php.net/manual/en/function.strlen.php strlen]||Get string length||int strlen(string)
|-
|[http://www.php.net/manual/en/function.strpos.php strpos]||Find position of first occurrence of an unicode string (starting by 0, return false if not found)||int strpos(haystack, needle <nowiki>[</nowiki> offset=0])
|-
|[http://www.php.net/manual/en/function.strrev.php strrev]||Reverse a string||string strrev(string)
|-
|[http://www.php.net/manual/en/function.strstr.php strstr]||Find first occurrence of a string||string strstr(haystack, needle<nowiki>[</nowiki>, before_needle=false])
|-
|[http://www.php.net/manual/en/function.strtolower.php strtolower]||Make a string lowercase||string strtolower(string)
|-
|[http://www.php.net/manual/en/function.strtotime.php strtotime]||Parse about any English textual datetime description into a Unix timestamp||int strtotime(string)
|-
|[http://www.php.net/manual/en/function.strtoupper.php strtoupper]||Make a string uppercase||string strtoupper(string)
|-
|[http://www.php.net/manual/en/function.substr.php substr]||Return part of an unicode string||string substr(string, start <nowiki>[</nowiki>, length])
|-
|sum||Calculate the sum of values in an array||number sum(arg1, arg2, ... argN)
|-
|sumifop||Sum the values of answered questions in the list which pass the criteria (arg op value)||number sumifop(op, value, arg1, arg2, ... argN)
|-
|[http://www.php.net/manual/en/function.tan.php tan]||Tangent||number tan(arg)
|-
|[http://www.php.net/manual/en/function.time.php time]||Return current UNIX timestamp||number time()
|-
|[http://www.php.net/manual/en/function.trim.php trim]||Strip whitespace (or other characters) from the beginning and end of a string||string trim(string <nowiki>[</nowiki>, charlist])
|-
|[http://www.php.net/manual/en/function.ucwords.php ucwords]||Uppercase the first character of each word in a string||string ucwords(string)
|-
|unique||Returns true if all non-empty responses are unique||boolean unique(arg1, ..., argN)
|}
関数 意味 構文
abs 絶対値 number abs(数値)
acos アークコサイン number acos(数値)
addslashes 文字列をスラッシュで引用 string addslashes(文字列)
asin アークサイン number asin(数値)
atan アークタンジェント number atan(数値)
atan2 2変数のアークタンジェント number atan2(数値, 数値)
ceil 切り上げ number ceil(数値)
checkdate グレゴリオ暦で有効な日付であれば真(1)を返す bool checkdate(月,日,年)
convert_value 変換元リストにある数値を対応する変換先リストの数値に変換する number convert_value(変換する数値, 一致フラグ, 変換元リスト, 変換先リスト)
cos コサイン number cos(数値)
count リスト内で回答された(空白でない)質問の数 number count(引数1, 引数2, ..., 引数N)
countif 回答された質問のうち、比較値と等しいリスト内の回答の数 number countif(比較値, 引数1, 引数2, ... 引数N)
countifop 回答された質問のうち、条件を満たすリスト内の回答の数(回答 演算子 比較値) number countifop(演算子, 比較値, 引数1, 引数2, ... 引数N)
date 指定した、もしくはローカルの日付/時刻を書式化する string date(日付書式[, 指定時刻=time()])
exp eの累乗を計算する number exp(数値)
fixnum 必要に応じてカンマで区切られた数字を表示する string fixnum(数値)
floor 切り捨て number floor(数値)
gmdate 指定した、もしくは現在のGMTの日付/時刻を書式化する string gmdate(日付書式 [, 指定時刻=time()])
html_entity_decode HTML エンティティを文字に変換する(常にENT_QUOTESとUTF-8を使用) string html_entity_decode(文字列)
htmlentities 文字をHTML エンティティに変換する(常にENT_QUOTESとUTF-8を使用) string htmlentities(文字列)
expr_mgr_htmlspecialchars 特殊文字をHTML エンティティに変換する(常にENT_QUOTESとUTF-8を使用) string htmlspecialchars(文字列)
expr_mgr_htmlspecialchars_decode HTML エンティティを特殊文字に変換するHTML エンティティに変換する string htmlspecialchars_decode(文字列)
idate 指定した、もしくは現在のローカルな時刻/日付を整数として整形する string idate(文字列 [, 指定時刻=time()])
if Excelスタイルのif(条件,trueの時の結果,falseの時の結果) if(条件,trueの時の結果,falseの時の結果)
implode 配列要素を文字列により連結する string implode(区切り文字,引数1,引数2,...,引数N)
intval 変数の整数としての値を取得する int intval(数値 [, 基数=10])
is_empty 変数が空であるかどうかをを判定する bool is_empty(変数)
is_float 変数の型が浮動小数点型かどうかを判定する bool is_float(変数)
is_int 変数が整数型かどうかを判定する bool is_int(変数)
is_nan 値が数値でないかどうかを判定する bool is_nan(変数)
is_null 変数がNULLかどうかを判定する bool is_null(変数)
is_numeric 変数が数字または数値を示す文字列であるかを判定する bool is_numeric(変数)
is_string 変数の型が文字列かどうかを判定する bool is_string(変数)
join (2.0 build 130129から追加) 要素を新しい文字列として結合する join(引数1, 引数2, ... 引数N)
list 空白でない値をコンマ区切りリストで返す string list(引数1, 引数2, ... 引数N)
listifop (3.16.1 から追加) リスト内の質問のうち、条件(属性 演算子 値)を満たす質問属性(retProp)を抽出し、指定の文字で区切ったリストとして返す string listifop(属性, 演算子, 値, 質問属性, 区切り文字, sgqa1, sgqa2, ... sgqaN)
ltrim 文字列の最初から空白 (もしくはその他の文字) を取り除く string ltrim(文字列 [, 削除する文字のリスト])
max 最大値を探す number max(引数1, 引数2, ... 引数N)
min 最小値を探す number min(引数1, 引数2, ... 引数N)
mktime 日付をUNIXのタイムスタンプとして取得する(引数は省略可) number mktime([時 [, 分 [, 秒 [, 月 [, 日 [, 年 ]]]]]])
モジュロ関数 モジュロ関数はまだサポートされていません。代わりにfloor()関数を使用します。 floor(x/y)==(x/y)
nl2br 改行文字の前にHTMLの改行タグを挿入する string nl2br(文字列)
number_format 数字を千位毎にグループ化してフォーマットする string number_format(数値)
pi 円周率 number pi()
pow 指数表現 number pow(基数, 指数)
quoted_printable_decode quoted-printable文字列を8ビット文字列に変換する string quoted_printable_decode(文字列)
quoted_printable_encode 8ビット文字列をquoted-printable文字列に変換する string quoted_printable_encode(文字列)
quotemeta メタ文字をクォートする string quotemeta(文字列)
rand 乱数を生成する( int rand()またはint rand(最小値, 最大値)
regexMatch 文字列を正規表現で比較する bool regexMatch(パターン,文字列)
round 数値を任意の精度に丸める number round(値 [, 丸める桁位置])
rtrim 文字列の最後から空白(またはその他の文字)を取り除く string rtrim(文字列 [, 削除する文字のリスト])
sin サイン number sin(数値)
sprintf フォーマットされた文字列を返 string sprintf(フォーマット, 引数1, 引数2, ... 引数N)
sqrt 平方根 number sqrt(数値)
stddev リストの数値について標本の標準偏差を計算する number stddev(引数1, 引数2, ... 引数N)
str_pad 文字列を固定長になるまで他の文字列で埋める string str_pad(入力文字列, 文字列の長さ [, 埋める文字])
str_repeat 文字列を反復する string str_repeat(入力文字列, 繰り返し回数)
str_replace 検索文字列に一致したすべての文字列を置換する string str_replace(検索文字列, 置き換える値, 対象の文字列)
strcasecmp 大文字小文字を区別しないバイナリセーフな文字列比較を行う int strcasecmp(文字列1, 文字列2)
strcmp バイナリセーフな文字列比較を行う int strcmp(文字列1, 文字列2)
strip_tags 文字列からHTMLおよびPHPタグを取り除く string strip_tags(文字列, 取り除かないタグ)
stripos 大文字小文字を区別せずに文字列が最初に現れる位置を探す(0から始まり、現れなければfalse) int stripos(対象文字列, 検索文字列 [, 開始位置=0])
stripslashes クォートされた文字列のクォート部分を取り除く string stripslashes(文字列)
stristr 大文字小文字を区別しないstrstr string stristr(対象文字列, 検索文字列 [, 最初の一致箇所より前のみを返すかのフラグ=false])
strlen 文字列の長さを得る int strlen(文字列)
strpos Unicode文字列内の部分文字列が最初に現れる場所を見つける(0から始まり、現れなければfalse) int strpos(対象文字列, 検索文字列 [ 開始位置=0])
strrev 文字列を逆順にする string strrev(文字列)
strstr 文字列が最初に現れる位置を見つける string strstr(対象文字列, 検索文字列[, 最初の一致箇所より前のみを返すかのフラグ=false])
strtolower 文字列を小文字にする string strtolower(文字列)
strtotime 英文形式の日付をUnixタイムスタンプに変換する int strtotime(文字列)
strtoupper 文字列を大文字にする string strtoupper(文字列)
substr unicode文字列の一部分を返す string substr(文字列, 開始位置 [, 長さ])
sum 配列中の値の合計 number sum(引数1, 引数2, ... 引数N)
sumifop 回答された質問のうち、条件を満たすリスト内の回答の合計(回答 演算子 比較値) number sumifop(演算子, 値, 引数1, 引数2, ... 引数N)
tan タンジェント number tan(数値)
time 現在のUnixタイムスタンプを返す number time()
trim 文字列の先頭および最後から空白(またはその他の文字)を取り除く string trim(文字列 [, 削除する文字のリスト])
ucwords 文字列の各単語の最初の文字を大文字にする string ucwords(文字列)
unique 空白以外の回答のすべてが一意である場合にtrueを返す boolean unique(引数1, ..., 引数N)