This shows you the differences between two versions of the page.
uphp:functions:strval [2017/05/08 14:36] jeff |
uphp:functions:strval [2021/09/13 05:57] |
||
---|---|---|---|
Line 1: | Line 1: | ||
- | ======strval====== | ||
- | |||
- | < | ||
- | |||
- | < | ||
- | |||
- | ====Description==== | ||
- | |||
- | <well size=" | ||
- | < | ||
- | <span style=" | ||
- | <span style=" | ||
- | <span style=" | ||
- | <span style=" | ||
- | <span style=" | ||
- | </ | ||
- | </ | ||
- | |||
- | Type cast an < | ||
- | |||
- | ====Parameter==== | ||
- | |||
- | < | ||
- | |||
- | ====Return Value==== | ||
- | |||
- | ^< | ||
- | |< | ||
- | |< | ||
- | |< | ||
- | |||
- | ====Examples==== | ||
- | |||
- | <code php> | ||
- | < | ||
- | | ||
- | $i=100; | ||
- | $str=strval($i); | ||
- | print(" | ||
- | |||
- | $f=1.55; | ||
- | $str=strval($f); | ||
- | print(" | ||
- | | ||
- | $s=" | ||
- | print(" | ||
- | | ||
- | $arr1=array(); | ||
- | print(" | ||
- | |||
- | $arr2=array(" | ||
- | print(" | ||
- | |||
- | ?></ | ||
- | </ | ||
- | |||
- | The above example will output: | ||
- | |||
- | < | ||
- | The string value of the integer ' | ||
- | The string value of the float ' | ||
- | The string value of the string '100 dollars' | ||
- | strval($arr1)='' | ||
- | strval($arr2)='' | ||
- | </ | ||
- | |||
- | ====Note==== | ||
- | |||
- | This function performs no formatting on the returned value. If you are looking for a way to format a numeric value as a < | ||
- | |||
- | [[number_format()]] - Format the < | ||
- | |||
- | [[print(f)]] - Print a formatted < | ||
- | |||
- | [[sprintf()]] - < | ||
- | |||
- | [[strftime()]] - Format a Linux timestamp using a format < | ||
- | |||
- | ====See Also==== | ||
- | |||
- | [[intval()]] - < | ||
- | |||
- | [[floatval()]] - < | ||
- | |||
- | [[is_numeric()]] - < | ||
- | |||
- | [[uphp: | ||